[NTLUG:Discuss] Sharing Internet Connection

sysmail@glade.net sysmail at glade.net
Thu Dec 13 16:23:05 CST 2001


I do this all the time - but I'm still using ipchains, not iptables.

Basically, add /etc/sysconfig/network-scripts/ifcfg-eth1 (if it's not
there) with something like:

DEVICE=eth1
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.1
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes

Alternatively, add 'ifconfig eth1 192.168.01. netmask 255.255.255.0
broadcast 192.168.0.255 up' to someplace convenient, like
/etc/rc.d/rc.local.

Then, configure the machines that will be on eth1's port to have addresses
in 192.168.0.0/24 (.2, .3, etc.). Use 192.168.01. for their gateway
addresses, and 255.255.255.0 as the netmask. Season your DNS settings to
taste.

Add to your /etc/rc.d/rc.local file:

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

That will turn on forwarding.

Then add, also to rc.local:

ipchains -P forward DENY
ipchains -A forward -s 192.168.0.0/24 -j MASQ

Presto - ip masquerading.  Um, that assumes you have ipchains (or
iptables, if you prefer) compiled in to your kernel.  You can test that, I
believe, with the command 'ipchains -L -n'.  No errors should mean the
support is there.

Regards,

Carl


On 13 Dec 2001, Patrick Parks wrote:

> Date: 13 Dec 2001 16:07:13 -0600
> From: Patrick Parks <pparks at c1652034-e.croltn1.tx.home.com>
> Reply-To: discuss at ntlug.org
> To: discuss at ntlug.org
> Subject: [NTLUG:Discuss] Sharing Internet Connection
>
> Hello all, I am trying to set up internet sharing with two computers and
> having a problem. The server is a redhat 7.1 box with two nics. eth0






More information about the Discuss mailing list