Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I have a network that is connected to the internet via a switch connected to a router. I have it setup like this so I can work on the new network without causing problems on the old.

Anyway, I'm trying to enable internet connection sharing. Internet comes to server like this:

Modem -> Router -> Switch -> Ubuntu 11.10 (Eth0)

I want to share the connection through Eth1 (Eth1 -> Managed Switch -> Clients). Here is my config for /etc/network/interfaces:

I have a DHCP server running on Eth1. Here is my config:

ddns-update-style none;

option domain-name "myserver.local";
option domain-name-servers,;
default-lease-time 600;
max-lease-time 7200;


subnet netmask {
  interface eth1;
  option routers;
  option subnet-mask;
  option broadcast-address;

Here is /etc/network/interfaces:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

#Used for internal network
auto eth1
iface eth1 inet static

Here is /etc/hosts:       localhost     server     server.myserver.local server myserver.local

In /etc/sysctl.conf, I've set the following:


Finally, in /etc/rc.local, I've set the following:

/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables --table nat -A POSTROUTING -o eth1 -j MASQUERADE

When I ping (google's DNS) from a client that is authenticated with my DHCP server (they have been assigned a local ip, like, I get a timeout.

How can I debug this further to figure out where my problem is?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Got this working! Changed

option routers; 


option routers;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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