Change IP address of ethernet device while system is running

Tom H tomh0665 at gmail.com
Wed Dec 28 08:44:26 UTC 2016


On Thu, Dec 8, 2016 at 6:53 AM, Christoph Pleger
<Christoph.Pleger at cs.tu-dortmund.de> wrote:
>
> on a computer running Ubuntu 16.04, I am trying to change the static
> IP address of an ethernet device, while the system is running.
> Therefore, I edit the file /etc/network/interfaces.d/${IFNAME} and
> then execute the command 'service networking restart'. But with that,
> the ethernet device is not switched to the new IP address, but it
> keeps the old address and gets the "new" address as secondary IP
> address. In former versions of Ubuntu, with the same steps as above,
> the old IP address was replaced by the new one.
>
> What do I have to do now to switch the IP address without a reboot?

IIRC, 'service networking restart' used to take down lo and, at least
with upstart, it was a no-op that displayed an error message.

It's best to run

# ifdown $ifname
# vi /etc/network/interfaces.d/$ifname
# ifup $ifname




More information about the ubuntu-users mailing list