1

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 255.255.255.255 ( " )
Modem Address : 192.168.1.1

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

auto eth0
iface eth0 inet static
address 59.X.X.10
netmask 255.255.255.255
gateway 59.X.X.1
network 59.X.X.0
broadcast 59.X.X.255
dns-nameservers 8.8.8.8 4.4.4.4

auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

Now when I save and restart the service, I cannot even ping to 192.168.1.1 or get internet connection from this server machine itself. I also tried to change gateway of eth0 to 192.168.1.1 , 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 255.255.255.0. 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 '14 at 17:48
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.

HTH

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.