Using Linux as a Router

Rick Stevens rstevens at vitalstream.com
Wed Sep 22 17:00:43 UTC 2004


Waldher, Travis R wrote:
> Anyone got a how to sitting around?
> 
> I'de like to use Redhat for my home firewall/router, but can't find any
> good info on how to forward IP from one NIC to the other.
> 
> I have a machine on the private side NIC(eth1) of the router that can
> ping the public NIC(eth0) of the router.  But nothing beyond eth0.
> :confused:

You need to set the "ip_forward" flag in the kernel:

	echo 1 >/proc/sys/net/ipv4/ip_forward

To make that permanent, edit /etc/sysctl.conf and look for this line:

	net.ipv4.ip_forward = 0

Change the "0" to "1" and save it.  ip_forward will be set on the next
reboot.

If you're going to do a full-up router, don't forget about your NAT
rules in iptables (a.k.a. "Masquerade").  For info on that, see:

	http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/index.html

----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-         "OK, so you're a Ph.D. Just don't TOUCH anything!"         -
----------------------------------------------------------------------





More information about the Redhat-install-list mailing list