I have looked at all the solutions about how to stop/start/reload the network stack when using netplan configurations (without installing NetworkManager or nmcli) and none of them seem to give a complete option of how to restart the network stack.
I tried:
sudo systemctl stop networking; sudo systemctl start networking
sudo systemctl restart networking
sudo systemctl restart sytemd-networking
sudo ifdown ; sudo ifup interface
and obviously
sudo netplan apply
I'm looking for a method that essentially will turn off all the networking and start everything from scratch - as if it were a reboot but without having to reboot. This is especially critical when VLANs are defined since none of the methods that I have tried know how to remove a VLAN definition even if it not longer appears in the /etc/netplan/*.yaml files.
Here is an example netplan file that I was using (this one doesn't include a VLAN though but happened with this file as well):
$ cat /etc/netplan/01-network-manager-all.yaml
network:
version: 2
renderer: networkd
ethernets:
enp226s0:
dhcp4: no
addresses: [192.168.10.32/24]
gateway4: 192.168.10.254
nameservers:
addresses: [192.168.1.11]
search: [road2.local]
enp225s0f0:
dhcp4: no
mtu: 9000
enp225s0f1:
dhcp4: no
mtu: 9000
bonds:
bond0:
dhcp4: no
mtu: 9000
interfaces:
- enp225s0f0
- enp225s0f1
parameters:
mode: balance-rr
mii-monitor-interval: 100
bridges:
br0:
dhcp4: no
mtu: 9000
interfaces:
- bond0
addresses: [192.168.1.10/24]
gateway4: 192.168.1.254
routes:
- to: 192.168.9.0/24
via: 192.168.1.254