1

I have an ubuntu droplet on www.digitalocean.com, after i changed a few lines of code in my application, i restarted the server, still have access to it through web console but no interfaces has founded, just docker0 and lo, can't ping google even!!

here are my interfaces.d/50-cloud-init.cfg file configurations: auto lo iface lo inet loopback dns-nameservers 8.8.8.8 8.8.4.4

auto eth0
iface eth0 inet static
    address 139.59.148.230
    gateway 138.59.144.1
    netmask 255.255.255.0
    172.17.0.1

# control-alias eth0
iface eth0 inet static
    address 10.135.0.1
    netmask 255.255.0.0

eth0 interface is not showing after ifconfig -a command, i got ens3, ens4, lo, docker0, so i changed the eth0 to one of these ens* but without avail.

I've tried also to assign the ip to the interface statically after restarting the networking service service networking restart, it throwing this error:

ifup[774]: /sbin/ifup: pre-up script failed
systemd[1]: networking.service Main process exited
systemd[1]: Failed to start Raise network interfaces
1

1 Answer 1

1

Your server and default gateway need to be on the same subnet

When you set your netmask to 255.255.255.0 you are telling the interface it can only broadcast to other addresses on 139.59.148.x. Anything else needs to go through your gateway, but your gateway is on 138.59.144.1

As the saying goes, "you can't get there from here."

Either the gateway address is incorrect, or you need to change your ip address or netmask. Right now your local device can't broadcast to the default gateway because they are not on the same subnet.

address 139.59.148.230
gateway 138.59.144.1

EDIT: Just a theory, but could the default gateway possibly contain an error? Should it have been 139.59.x.x? If so, and your subnet was set to 255.255.249.0 you could broadcast to the default gateway at that point.

11
  • Public IP address is set to 138.59.144.1 , gateway 138.59.144.1, netmask 138.59.144.1, these are from Networking settings, but i can't understand why is Private IP is different 10.135.xxx.xxx ??
    – swordfish
    Commented Dec 6, 2019 at 21:16
  • You say netmask = 138.59.144.1? Respectfully, that doesn't sound right either.
    – Lumberjack
    Commented Dec 6, 2019 at 21:19
  • @swordfish you have two interfaces called eth0. That is a problem in addition to the subnet / gateway issue. Maybe call the second one eth1?
    – Lumberjack
    Commented Dec 6, 2019 at 21:20
  • oh yeah thats my mistake i didn't noticed that, got to change to the correct one but also the error shows again!
    – swordfish
    Commented Dec 6, 2019 at 21:24
  • I have no eth* interfaces, just ens3 and ens4
    – swordfish
    Commented Dec 6, 2019 at 21:26

You must log in to answer this question.

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