I am trying to set up a freebsd router that sits between the cable/dsl modem and my lan machines. Here is the logical setup:
Cable/DSL modem connected to internet:
gateway 192.168.0.1 FreeBSD Router (with two nics):
em0 192.168.0.121 ue0 10.0.0.1 FreeBSD Lan Machine:
em0 10.0.0.2 It seems like the path from the lan to the wan should be 10.0.0.2->10.0.0.1->192.168.0.1->wan and that I should be able to ping a machine on the internet from the lan machine.
In summary, though:
- The internet is accessible from the FreeBSD router.
- The lan machine is acccessible from the FreeBSD router.
- The FreeBSD router is accessible from the lan machine.
- The internet is not accessible from the lan machine.
Here are the /etc/rc.conf entries on the router:
ifconfig_ue0="inet 10.0.0.1 netmask 255.255.255.0" ifconfig_em0="inet 192.168.0.121 netmask 255.255.255.0" gateway_enable="YES" defaultrouter="192.168.0.1" Here are the /etc/rc.conf entries on the lan machine:
ifconfig_em0="inet 10.0.0.2 netmask 255.255.255.0" defaultrouter="10.0.0.1" Here are the routing table entries from the FreeBSD router (loki):
netstat -r Routing tables Internet: Destination Gateway Flags Netif Expire default 192.168.0.1 UGS em0 10.0.0.0/24 link#3 U ue0 10.0.0.1 link#3 UHS lo0 127.0.0.1 link#2 UH lo0 192.168.0.0/24 link#1 U em0 192.168.0.121 link#1 UHS lo0 Here are the routing table entries from the lan machine (freebird):
netstat -r Routing tables Internet: Destination Gateway Flags Netif Expire default 10.0.0.1 UGS em0 10.0.0.0 link#1 U em0 10.0.0.2 link#1 UHS lo0 freebird link#2 UH lo0 netstat on the lan machine is sloooowwwww.
Does this information appear correct for the setup, or is there an apparent problem??
pppoeon your freebsd box? that will be a lot simpler and a lot less problematic because then everthing is done on the freebsd box (and its external NIC,em0i think, has the public internet address).netstat -rnto test. it doesnt solve your problem, but i recommend running a local dns resolver (e.g. unbound) on your freebsd gw and configuring all the lan machines (perhaps via dhcp) to use it.ipfwand NAT