# FreeBSD as a router



## gpatrick (Oct 22, 2009)

My PC has 3 NICs and I want to use it as a router but also have a couple of web servers running in jails.  

If the WAN connection goes to NIC1 and NIC2 be the DMZ while I have NIC3 used for the reverse proxy?  NIC2 and NIC3 would both be plugged into a hub.

So ISP on NIC1 xxx.xxx.xxx.xxx and NIC2 would then become something like 192.168.1.1 while NIC3 would be 192.168.1.10.  Then jails would be something like 10.0.0.2, 10.0.0.3.

Plausible and doable?


----------



## SirDice (Oct 22, 2009)

If you want to route traffic between NIC2 and NIC3 they cannot be in the same subnet.


----------



## gpatrick (Oct 22, 2009)

Thank you.

In place of the hub what about a switch and would I need to use separate VLANs for nic2 and nic3?


----------



## aragon (Oct 23, 2009)

What are you trying to gain by using 3 nics?  Sounds like you just need nic1 and nic2.


----------



## gpatrick (Oct 23, 2009)

What interface would I alias for the reverse proxy if I didn't use NIC3? NIC2 goes to a hub and i have a windows machine to connect, and the FreeBSD machine will also be a WAP for a laptop.


----------



## SirDice (Oct 23, 2009)

Err... Nobody uses hubs anymore, they're all switches these days.


----------



## gpatrick (Oct 23, 2009)

I have an old hub and am cheap...use what I have. I can buy a switch, so replace hub with switch.  What alias is used for the reverse proxy if I don't use NIC3?


----------



## SirDice (Oct 23, 2009)

Bind the reverse proxy to NIC1 (WAN connection) and have it proxy its requests to the webserver on the NIC2 network. There's no need for aliases.

If you're going to run the reverse proxy and the webserver itself on the same box you'll only need 1 NIC.


----------



## gpatrick (Oct 23, 2009)

Thanks.


----------

