Thread: nat HELP
View Single Post
  #1   (View Single Post)  
Old 1st February 2009
dextro dextro is offline
Port Guard
 
Join Date: Dec 2008
Posts: 21
Default nat HELP

So, I have been running FreeBSD as my router for sometime now and like it a lot, ran into a problem recently however

I've managed to forward ports to PCs across my network without problem until I tried to forward some UDP for a game, it doesn't work.

Code:
nat on $ext1 from !($ext1) -> ($ext1:0)
rdr on $ext1 proto {tcp, udp} from any to any port {1234} -> $pc1
above configuration does not work. I think the packets make it to the game but PF does something to them and the game doesn't recognize them (I'm no expert but that's what I've gathered so far).

Code:
binat on $ext1 from $pc1 to any -> $ext1
above works fine, games and all applications on pc1 can connect out and accept connections, one major flaw though, the rest of my network has no internet connectivity!

Some people have suggested I get another IP from my ISP and binat 1 to pc1 and nat the second to the rest of my lan, this would be fine if my ISP allowed static IPs. I am actually allowed 2 IPs but they have to be obtained with DHCP and can only obtain one per interface so as far as I can tell... I would have to setup my network as layed out in the attached image. Seems a little crazy to me to change the network so much (1 new switch, 2 new nic in gateway) just to get a game working. I should also note the game worked fine when I forwarded port 1234 when I was using some $20 Linksys POS.

Finally, I had the idea to create a virtual interface on the gateway and bridge it to my modem's interface, this might allow me to set the MAC sent to my ISP DHCP server thus it leasing me the second IP. No idea how to create virtual interfaces or bridge on FreeBSD though :P
( page that give me this idea http://ezine.daemonnews.org/200406/netgraph.html )

Thanks in advance to anyone that helps me figure this out!!
Attached Images
File Type: jpg insane.jpg (16.0 KB, 64 views)
Reply With Quote