In Ubuntu or Debian, information on network interface configuration is stored in /etc/network/interfaces.
If you modify /etc/network/interfaces to reconfigure any interface, you need to reload it so that the new configuration can take effect.
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.2.7 netmask 255.255.255.0 network 192.168.2.0 broadcast 192.168.2.255 gateway 192.168.2.1 dns-nameservers 188.8.131.52 192.168.193.20 dns-search unitn.it
Here is how you can reload /etc/network/interfaces.
sudo service networking restart
One caveat: If NetworkManager is installed and enabled on your system, it will interfere with you reloading /etc/network/interfaces. On Ubuntu Desktop, for example, NetworkManager is enabled by default. Thus you first need to disable NetworkManager before attempting to reload /etc/network/interfaces.
To disable NetworkManager, do the following.
$ sudo service network-manager stop $ sudo update-rc.d NetworkManager remove
If you don’t want to disable NetworkManager, another option is to edit NetworkManager configuration, and add “managed=false” as follows. Then, restart NetworkManager.
$ sudo service network-manager restart
Last updated: 10 Febbraio 2015 by Pierluigi Minati