Thursday, August 13, 2009

pf and Left 4 Dead

I couldn't get the lobby system to work when playing Left 4 Dead through my FreeBSD firewall (using pf). No one joined my public lobbies.

After a bit of investigating, I found that you need to have static-port enabled for UDP NAT in pf.

So, I changed this:

nat on $extif from $intif:network to any -> ($extif)

into this:

nat on $extif proto udp from $intif:network to any -> ($extif) static-port
nat on $extif proto tcp from $intif:network to any -> ($extif)

...in pf.conf

So now, udp packets do not get a new source port when passing through the firewall - and voila! - Left 4 Dead lobbies work.

(Note: Remember to assign a different clientport for each computer behind the firewall that wants to play a source based game.)

No comments: