network restart fail on Ubuntu server 16.04
13,931
I think it is a bug in Ubuntu network scripts.
If you will modify network interface and then do the ifdown
it will fail. You must first bring the interface down. Then you can modify the file and then bring the interface up again:
$ ifdown eth0
$ $EDITOR /etc/network/interfaces
$ ifup eth0
Related videos on Youtube
Author by
sheitan
Favorite Languages : Java , Scala , Bash , C/C++ , Python Favorite IDE : IntelliJ IDEA , Netbeans Favorite Editor : VSCode , Vim
Updated on September 18, 2022Comments
-
sheitan over 1 year
In Ubuntu 16.04 server I want to change IP from /etc/network/interfaces and run
sudo service networking restart
and there is no error given but the IP didn't change.I also ran
sudo systemctl networking restart
andsudo ifdown eth0 && sudo ifup eth0
but the IP doesn't change. How do I restart the network interface in Ubuntu 16.04 so it saves the changes?-
UeliDeSchwert almost 8 yearsI think you're on a normal home-network. Those use usually the Dynamic Host Configuration Protocol (DHCP). If the DHCP-Server doesn't assign that IP to you, you won't get that IP (no matter what you configure on /etc/networking/interfaces). Worse, you could even get no net at all, if you misconfigured.
-
sheitan almost 8 years@ManuToMatic I need to set static IP on interface!
-
UeliDeSchwert almost 8 yearsYes, and in the DHCP-Server too. If your server says "Yo, I'm configured to use
192.0.0.42
so give it to me!" but your DHCP (Router/Modem) answers "Yeah, nice. But I only distribute192.168.0.2
to192.168.0.50
so you get that nice192.168.0.31
", then your server gets192.168.0.31
and not the IP he wants. If you want more information about how DHCP works: en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol -
sheitan almost 8 years@ManuToMatic I don't have any DHCP server in my network and need set static IP
-
UeliDeSchwert almost 8 yearsWhat? So how is your network configured? Believe me, if you didn't do anything special, your router IS a DHCP-Server. Alternatively you could explain exactly how your network is set up so we'd know more specific what we're on.
-
sheitan almost 8 yearsI need to set static IP and change IP work properly in Ubuntu14.04. I need set static IP On Ubuntu Server 16.04. I cant setup DHCP server in my network.
-
-
Dániel Kis almost 5 yearsIt seems to be a bug, but sometimes ubuntu needs to be restarted