How do I assign static IP addresses to interfaces in Ubuntu (17.04) without rebooting the machine? This is pretty straightforward on a Unix machine, but I'm having trouble on this one.
Please don't mark this as duplicate (just yet). I've read a number of other posts, but the instructions don't seem to work.
I'm configuring a bunch of routers and switches and I need to be able to:
- Permanently (survives a reboot/crash) change the the IP of an interface
- Permanently (survives a reboot/crash) change the interface back to DHCP (or BOOTP, or whatever)
- Make these changes without X (and with, from an
I've already tried editing
/etc/network/interfaces and running
/etc/init.d/networking restart as mentioned here. This failed to change anything until I rebooted.
The machine was originally set up with DHCP. I'd like to be able to go back and forth quickly. The machine has several interfaces, and because it's used to configure other people's networks, I need to be able to switch them with as little fuss as possible.
If I boot it with a static IP, what do I need to do the get a DHCP address?
If I boot with DHCP and switch to static, will I have to kill off
dhclient? What about other DHCP controlled interfaces?