1

I cannot find a way to start network interfaces with proper config after I changed config files (eg dhcpcd.conf). The only way I found to take the new config into account is to reboot. There must be a more elegant way. Though, service networking restart + systemctl restart dhcpcd.service + ip link set ethx down/up, don't work.

Update with info from comment:
To explain more, I change static ip declarations and don't want to reboot just for that.

Ingo
  • 42,961
  • 20
  • 87
  • 207
sugarman
  • 129
  • 4

1 Answers1

2

If you only want to change the static ip address on an interface you can just do it with ip address in two steps, for example:

rpi ~$ sudo ip address del 192.168.0.1/24 dev eth0
rpi ~$ sudo ip address add 192.168.0.2/24 dev eth0

ip address has also options change and replace but these will not modify the ip address, but only the flags of an existing ip address. For further information about this look at understanding “ip addr change” and “ip addr replace” commands.

You can also use systemd-networkd. There you have many options to configure interfaces. I can confirm that can change interface setup without reboot. How to use systemd-networkd you can look at Howto migrate from networking to systemd-networkd with dynamic failover.

Ingo
  • 42,961
  • 20
  • 87
  • 207