Cannot enable private IP address

June 3, 2018 103 views
Nginx Ubuntu 16.04

I am following the tutorial given in the link https://www.digitalocean.com/community/tutorials/how-to-enable-digitalocean-private-networking-on-existing-droplets#ubuntu-1604 to set up private IP in the existing droplet.I added this

auto eth1
iface eth1 inet static
address DropletPrivateIP/16auto eth1
iface eth1 inet static
address DropletPrivateIP/16

I substituted the 'DropletPrivateIP' with my Pirvate IP and ran the command

"sudo systemctl restart networking"

Now I get the message

"Job for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details."

sadly the tutorial doe not say anything as what to do if we get any error message so here I want to ask what to do?

I ran the command "systemctl status networking.service" and I get:

● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled
Drop-In: /run/systemd/generator/networking.service.d
└─50-insserv.conf-$network.conf
Active: failed (Result: exit-code) since Sun 2018-06-03 10:40:48 UTC; 3min 57s ago
Docs: man:interfaces(5)
Process: 6245 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, sta
Process: 6328 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
Process: 6321 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifq
Main PID: 6328 (code=exited, status=1/FAILURE)

Jun 03 10:40:46 Starting Raise network interfaces...
Jun 03 10:40:48 Waiting for DAD... Done
Jun 03 10:40:48 Cannot find device "eth1"
Jun 03 10:40:48 Failed to bring up eth1.
Jun 03 10:40:48 networking.service: Main process exited, code=ex
Jun 03 10:40:48 Failed to start Raise network interfaces.
Jun 03 10:40:48 networking.service: Unit entered failed state.
Jun 03 10:40:48 networking.service: Failed with result 'exit-cod
lines 1-19/19 (END)

Any help?

Thank you!

1 Answer

Why you have this duplicity in config ?

auto eth1
iface eth1 inet static
address DropletPrivateIP/16auto eth1
iface eth1 inet static
address DropletPrivateIP/16

You should have one definition in config:

auto eth1
iface eth1 inet static
    address DropletPrivateIP/16

or try ( I never used /subnet, rather specify netmask ):

auto eth1
iface eth1 inet static
    address DropletPrivateIP
    netmask 255.255.0.0

Try reboot Droplet for networking changes. If Droplet hangs use console to comment out eth1 definition.

Have another answer? Share your knowledge.