Restarting networking service fails - Ubuntu 16.04
-
I have a fresh installation of Ubuntu 16.04 and I'm having issues setting up multiple static IPs. The first interface 'ens3' I was able to setup without any issues. On the rest of the interfaces, ens4-ens9, I keep getting an error message when trying to restart the networking service after setting the interface to static.
itdept@IT-DHCP:~$ sudo /etc/init.d/networking restart [sudo] password for itdept: [....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details. failed!
Here's what my /etc/network/interfaces file looks like...
# The loopback network interface auto lo iface lo inet loopback # The primary network interface # DMZ auto ens3 iface ens3 inet static address 10.0.0.36 netmask 255.255.224.0 gateway 10.0.1.1 dns-nameserver 10.0.0.21 10.0.0.22 # ADMIN_LAN auto ens4 iface ens4 inet static address 10.0.33.110 netmask 255.255.224.0 gateway 10.0.32.2 dns-nameserers 10.0.0.21 10.0.0.22
I have ens5-ens9 still set to dhcp till I figure out what's going on.
The interesting thing is that the static IP will work just fine after I reboot. I can ping 10.0.33.110 from my laptop just fine, but restarting the service will always fail. I feel like this is going to be an issue later on and would like to fix it, even if it's technically working.
-
Oh and the error hah...
itdept@IT-DHCP:~$ systemctl status networking.service ● 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 Tue 2018-10-23 14:33:55 EDT; 8min ago Docs: man:interfaces(5) Process: 2227 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE) Process: 2221 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=exited Main PID: 2227 (code=exited, status=1/FAILURE) Oct 23 14:33:55 IT-DHCP systemd[1]: Starting Raise network interfaces... Oct 23 14:33:55 IT-DHCP ifup[2227]: RTNETLINK answers: File exists Oct 23 14:33:55 IT-DHCP ifup[2227]: Failed to bring up ens4. Oct 23 14:33:55 IT-DHCP systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE Oct 23 14:33:55 IT-DHCP systemd[1]: Failed to start Raise network interfaces. Oct 23 14:33:55 IT-DHCP systemd[1]: networking.service: Unit entered failed state. Oct 23 14:33:55 IT-DHCP systemd[1]: networking.service: Failed with result 'exit-code'. lines 1-17/17 (END)
-
What does ...
sudo ifup -v ens4
... produce as output?
-
itdept@IT-DHCP:~$ sudo ifup -v ens4 Configuring interface ens4=ens4 (inet) /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d run-parts: executing /etc/network/if-pre-up.d/ethtool run-parts: executing /etc/network/if-pre-up.d/ifenslave + [ inet = meta ] + IF_BOND_SLAVES= + [ ] + [ ] + [ -z ] + exit run-parts: executing /etc/network/if-pre-up.d/vlan /bin/ip addr add 10.0.33.110/255.255.224.0 broadcast 10.0.63.255 dev en RTNETLINK answers: File exists Failed to bring up ens4. itdept@IT-DHCP:~$
-
@Markferron said in Restarting networking service fails - Ubuntu 16.04:
RTNETLINK answers: File exists
Are you perhaps running Network Manager on there?
-
Try...
sudo ifdown ens4 sudo ifup -v ens4
-
sudo systemctl restart NetworkManager.service
-
You misspelled dns-nameserver
-
@scottalanmiller
I think it worked...at least I don't see angry red text or the word fail anywhere...itdept@IT-DHCP:~$ sudo ifdown ens4 itdept@IT-DHCP:~$ sudo ifup -v ens4 Configuring interface ens4=ens4 (inet) /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d run-parts: executing /etc/network/if-pre-up.d/ethtool run-parts: executing /etc/network/if-pre-up.d/ifenslave + [ inet = meta ] + IF_BOND_SLAVES= + [ ] + [ ] + [ -z ] + exit run-parts: executing /etc/network/if-pre-up.d/vlan /bin/ip addr add 10.0.33.110/255.255.224.0 broadcast 10.0.63.255 dev en s4 label ens4 /bin/ip link set dev ens4 up /bin/ip route add default via 10.0.32.2 dev ens4 onlink /bin/run-parts --exit-on-error --verbose /etc/network/if-up.d run-parts: executing /etc/network/if-up.d/000resolvconf run-parts: executing /etc/network/if-up.d/ethtool run-parts: executing /etc/network/if-up.d/ifenslave + [ inet = meta ] + [ ] run-parts: executing /etc/network/if-up.d/ip run-parts: executing /etc/network/if-up.d/openssh-server run-parts: executing /etc/network/if-up.d/upstart run-parts: executing /e
-
@black3dynamite Yikes that's embarrassing...thank you.
-
@Markferron -- the little things that will come back and bite you.
-
@dafyre said in Restarting networking service fails - Ubuntu 16.04:
@Markferron -- the little things that will come back and bite you.
You've dealt with me too much. It's too easy for you.
-
@Markferron said in Restarting networking service fails - Ubuntu 16.04:
@dafyre said in Restarting networking service fails - Ubuntu 16.04:
@Markferron -- the little things that will come back and bite you.
You've dealt with me too much. It's too easy for you.
Not so much that, as I've been bitten in my (*@)&#$ more times than I care to count.
-
@dafyre said in Restarting networking service fails - Ubuntu 16.04:
@Markferron said in Restarting networking service fails - Ubuntu 16.04:
@dafyre said in Restarting networking service fails - Ubuntu 16.04:
@Markferron -- the little things that will come back and bite you.
You've dealt with me too much. It's too easy for you.
Not so much that, as I've been bitten in my (*@)&#$ more times than I care to count.
Mark, stop biting him!
-
Okay I'll bite, why the hell are you deploying 16.04?!
-
@DustinB3403 said in Restarting networking service fails - Ubuntu 16.04:
Okay I'll bite, why the hell are you deploying 16.04?!
I'm having issues with 18, and I need to get something up and running quickly. Do plan on moving it to 18 though.
-
@markferron wouldn't the fix here be to fix the issue in 18?
-
@DustinB3403
Hah, probably. Figured this would be the quicker route. -
@Markferron said in Restarting networking service fails - Ubuntu 16.04:
@DustinB3403 said in Restarting networking service fails - Ubuntu 16.04:
Okay I'll bite, why the hell are you deploying 16.04?!
I'm having issues with 18, and I need to get something up and running quickly. Do plan on moving it to 18 though.
Network works a little different with 18.04 and up. Netplan is how you manage your network configuration.
https://netplan.io/ -
@Markferron said in Restarting networking service fails - Ubuntu 16.04:
@DustinB3403 said in Restarting networking service fails - Ubuntu 16.04:
Okay I'll bite, why the hell are you deploying 16.04?!
I'm having issues with 18, and I need to get something up and running quickly. Do plan on moving it to 18 though.
You had issues on 16.04, too.