41

Ubuntu 18.04 LTS use netplan and systemd-networkd as default network config tool.

In earlier release, we can use service networking restart, or just ifdown & ifup to fully restart the network or an interface.

In 18.04, netplan tells just change the yaml file and use netplan apply .

When I change a bonding interface, just like hash policy, mtu, the netplan apply command doesn't make the new configuration effective.

Oh by the way, netplan shows render is networkd.

I search the whole internet to find a way to restart the network, but failed.

What I can do is reboot the server. This will make the new mtu and hash policy effective.

But just changing a network parameter, why i must reboot the whole server! Even a unstable windows server is not like this!

So, anyone can tell me what should I do?

List of methods I've already tried and failed:

  • systemctl restart systemd-networkd : restarted but mtu and policy not change
dlin
  • 3,900
TerryR01
  • 531

2 Answers2

51

netplan apply does the job.

In some cases you have to reboot.

3

For bond interfaces there is a problem. Currently after I modify the Netplan file, I do a Netplan apply for the Netplan to modify the systemd files. Then do a systemd restart for the changes to take effect. This has its own pitfalls.

In case the server has a nfs mounted, systemd never comes up and the network stack hangs. So we need to unmount the nfs, and restart the systemd networkd again.

  • 2
    upvoting as this answer guided me towards correct direction. Still netplan apply and systemctl restart systemd-networkd didnt do the job completly, I had to manually disable bond member ip link set dev enp4s0 down and do systemctl restart systemd-networkd – Arunas Bart Aug 29 '21 at 09:56
  • @ArunasBart We should note that this command will completely cut off all active ssh connections. – DaBler Jul 03 '25 at 12:09
  • please read carefully, I mentioned bond member, not the whole bond. You should have at least two members in a bond, and IP address set on a bond, not it's members. The whole idea of bond to have multiple physical links connected to one logical. And most of cases this will be HA setup. You still should have a connection even with a single physical link. – Arunas Bart Jul 04 '25 at 21:37