i tried to change the static ip address of one of my servers on the command line - and failed!
the original /etc/network/interfaces
looks something like this
auto enp2s0f0
iface enp2s0f0 inet static
address 192.168.0.57
netmask 255.255.255.0
gateway 192.168.0.1
auto enp2s0f1
iface enp2s0f1 inet static
address 192.168.1.57
netmask 255.255.255.0
and the configuration is ok when i boot the system. now i tried to change the subnet of the second interface to 192.168.10
. i edited /etc/network/interfaces
and tried to get the interface to accept this new configuration.
but no combination of
$ sudo systemctl restart networking.service
$ sudo ifdown enp2s0f1 && sudo ifup enp2s0f1
$ sudo ifconfig enp2s0f1 down && sudo ifconfig enp2s0f1 up
changes the ip address of that interface.
i am not sure if this is related to this bug or if i'm misunderstanding the new systemctl
-way of restarting services.
on ubuntu 12.04 this just worked fine.
just rebooting the machine works fine. but it must be possible to reload and apply the information in /etc/network/interfaces
(i even tried ifup
with the flag -i /etc/network/interfaces
- to no avail).
UPDATE:
as stated in this unanswered question: this works (but seems very clumsy):
$ sudo ifdown enp2s0f1
$ sudo ip addr flush dev enp2s0f1
$ sudo ifup enp2s0f1
is there really no simpler way in ubuntu 16.04?
0 Answers