[afnog] how do I configure my FreeBSD box as a gateway?

Phil Regnauld regnauld at x0.dk
Wed May 9 14:05:24 UTC 2007


Prince Martin (mchitimba) writes:
> Sorry I'm sort of amatuer in this but I need help. 
>    
>   I got FreeBSD running on a  machine that needs to act as a gateway for my internal network. I have two interfaces one connecting to the external network and one to the internal, both are working properly or so I think. I have internet on this machine and computers in my internal network can ping to this machine (and vice versa) but obviously they have no internet. I know I need to configure rc.firewall and do something else to complete the setup. Trouble is the rc.firewall on this FreeBSD is a little different from Linux and I want it all done Unix way. Please help, in as much detail as u possibly can. 

	a) read handbook http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-natd.html

	b) identify you external netcard

	c) as root:

echo >>/etc/rc.conf <<EOF
gateway_enable="YES"
natd_enable="YES"
natd_interface="ext_interface_name"		# f.eks. fxp0, vr0, etc...
EOF

	d) as root

	/etc/rc.d/routing restart
	/etc/rc.d/natd start

	... should do it.





More information about the afnog mailing list