Showing results for 
Search instead for 
Did you mean: 

internet pbm


internet pbm

hi all,

Im having two nic in my linux box .
i have connected a adsl modem to eth1 of my server.the ip for eth1 is, where the adsl modem has eth0 connects to my local network with ip do i allow my local network clients with ips to access the internet
Honored Contributor

Re: internet pbm

First, you want to enable 'ip forwarding'.

This can be done in a few ways depending on the distribution you have, but it all comes down to:

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

Use 'sysctl' (and '/etc/sysctl.conf') as the preferred method of routinely setting this.

Next is the firewall, in particular the 'FORWARD' section. This needs to have some decent rules, or have an ACCEPT policy. If you're using the firewall on your ADSL router, this is sort-of ok. If not, then set up the firewall on your Linux box properly.

Of course, you'll need to ensure that your linux box has a default route set through, so that traffic knows where to go after it's been allowed to forward.

Then all you need is to make sure you have a valid, working DNS server, and you're all good.
One long-haired git at your service...
Trusted Contributor

Re: internet pbm

# echo 1 > /proc/sys/net/ipv4/ip_forward
# echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
# iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
# service iptables save