I think i now find myself somewhere between cognitive overload and like a babe lost in the woods. Thus i hope someone out there can assist me! :)

I setup a Ubuntu 12.04 server on my home local network. It's a DHCP / Gateway setup following what seems to be the general idea in a tutorial. The box has two network cards. Internet connection is via PPPOE over a bridged ADSL router. Eth0 is the server's connection to the internet and eth1 is the interface to the lan.

I seem to suffer from the very common issue of the server has internet access (ping URL and IP works), clients on the LAN can ping both network interfaces of the server BUT they cannot ping URL or IP. They do not have internet access.

Thus my request, based on server details further down: How can i give internet access to local network via my server? Or alternatively what small semi-colon-error have i missed in my setup? :P

1. /etc/network/interfaces

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
        # dns-* options are implemented by the resolvconf package, if installed
        dns-search crowdControl.com
auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider dsl-provider
auto eth1
iface eth1 inet static

2. /etc/rc.local

/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A OUTPUT -o lo -j ACCEPT
/sbin/iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A OUTPUT -m conntrack --ctstate NEW,ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth1 -j ACCEPT
exit 0

3. /etc/dhcp/dhcp.conf

ddns-update-style none;
option domain-name "crowdControl.com";
option domain-name-servers,;
default-lease-time 3600;
max-lease-time 7200;
log-facility local7;
subnet netmask {
  option routers;
  option domain-name-servers,,;

4. route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    100    0        0 eth0   U     0      0        0 eth1   U     0      0        0 eth0

5. "watch -n 1 -d iptables -nvL" shows packet activity in the FORWARD CHAIN when i do try to ping something on the internet, from a local machine.

6. Pinging from machine on local network results in:

PING ( 56(84) bytes of data.
From icmp_seq=3 Destination Net Unreachable
From icmp_seq=4 Destination Net Unreachable
From icmp_seq=5 Destination Net Unreachable
From icmp_seq=7 Destination Net Unreachable

PS: I have come across many a similair Q&A but i cannot seem to get my settings to work, even if i try their solutions. Some examples i have found:


You should follow far4d's advice on net.ipv4.ip_forward... However, you should also do the same thing for net.ipv4.ip_dynaddr.

Simply go to the samre file he told you to edit (/etc/sysctl.conf) and instead of just inserting net.ipv4.ip_forward = 1 instead insert:

net.ipv4.ip_forward = 1
net.ipv4.ip_dynaddrn = 1  

Afterwards, do a sysctl -p as he recomended.


Please make sure that forwarding is enabled:

sysctl -n net.ipv4.ip_forward 

This should give you "1". If not, enabled packet forwarding by setting net.ipv4.ip_forward = 1 in /etc/sysctl.conf. Apply the new settings by typing:

sysctl -p 

This will allow you to run a DHCP server or client on the machine, instead of forcing you to actually use fixed address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.