Friends, I'm stuck up with problem regarding to network configuration to make my Ubuntu 14.04 server machine as internet gateway in a LAN, and I am a relatively newbie in this regard.

My scenario is as follows.
ISP Address 59.X.X.10
ISP Gateway 59.X.X.1 (as seen from modem router)
Netmask ( " )
Modem Address :

I edited the /etc/network/interface file as:

auto eth0
iface eth0 inet static
address 59.X.X.10
gateway 59.X.X.1
network 59.X.X.0
broadcast 59.X.X.255

auto eth1
iface eth1 inet static

Now when I save and restart the service, I cannot even ping to or get internet connection from this server machine itself. I also tried to change gateway of eth0 to , but no good.

Where am I wrong,? Do I have to make any particular changes to my broadband modem router?

  • Your netmask under eth0 is wrong, it should be Also, you don't really need to define network and broadcast, they're calculated automatically, so just don't put them. Lesser points of failure. Also, what's the output of ifconfig -a? You can edit your question by clicking on the small edit link right underneath it.
    – Alaa Ali
    Aug 6, 2014 at 17:48

1 Answer 1


AFAICS, your modem is already doing the routing/gateway job between your LAN and the WAN.

If you want to set up a gateway on your Linux box, you need to configure and start some software to link the WAN to the LAN (iptables is fine). You probably need to change the configuration of your modem from router to bridge and use pppoe to connect your ISP directly from the Linux server (if your using a DSL connection). Then, the eth0 configuration will be fine and will probably work, BUT, this configuration should be set in ppp configuration, not directly in the interface (ppp will do this for you). For now, configuring eth0 like this makes absolutely no sense if the modem acts like a gateway.

It's very difficult to reply more accurately, because we know very little of your LAN and your Internet connection. More of it, this is not one hour job and it can raise many security issues, so nobody can cover the topic in a single forum thread. There are some good networking Howto around. I would strongly suggest you to read them first.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .