I'm trying to figure out best way to control network settings in best way possible in real time.
My current plan is this:
ip -s -d -o monitorwith systemd and write its output to file generated with
mkfifoor write tiny script which outputs to tcp socket
- Write shell script which reads the file/socket and generate systemd network config files on the fly if there are changes and of course use other commands to read additional data for systemd configuration depending of the change
This way you can use
ip <cmd> command to change network settings in real time and also you can write systemd config files by hand and restarting
networkd and then again both
systemd's network settings stays in sync after boot.
Then the question: or is there even better way?
For example is there commands like:
systemd-networkd --add-vlan 123 --name lan
systemd-networkd --attach-vlan lan --device interface0
systemd-networkd --monitor --script /etc/network_changes_script.sh