From b84bdbf8dd25995aa564081632de6251ecf5ad4e Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 7 Nov 2025 22:05:59 +0100 Subject: vyos-netlinkd: T8047: replace netplugd Implementing a daemon that listens for netlink messages in Python was discussed for many years. This is a proof-of-concept implementation how we can listen for netlink messages and process them in Python. Python 3.10 minimum is required due to the use of case statements which mimics C-style switch/case instructions. Add example: set interfaces ethernet eth1 vif 21 address dhcp set interfaces ethernet eth1 vif 21 address dhcpv6 commit If network cable is unplugged: vyos-netlinkd[12681]: RTM_NEWLINK -> eth3.10, state=DOWN, mac=00:50:56:b3:9d:8e vyos-netlinkd[12681]: Stopping dhclient@eth3.10.service... vyos-netlinkd[12681]: Stopping dhcp6c@eth3.10.service... If cable is plugged back in: vyos-netlinkd[12681]: RTM_NEWLINK -> eth3.10, state=DOWN, mac=00:50:56:b3:9d:8e vyos-netlinkd[12681]: RTM_NEWLINK -> eth3.10, state=UP, mac=00:50:56:b3:9d:8e vyos-netlinkd[12681]: Restarting dhclient@eth3.10.service... vyos-netlinkd[12681]: Restarting dhcp6c@eth3.10.service... --- src/etc/netplug/linkup.d/vyos-python-helper | 4 ---- 1 file changed, 4 deletions(-) delete mode 100755 src/etc/netplug/linkup.d/vyos-python-helper (limited to 'src/etc/netplug/linkup.d/vyos-python-helper') diff --git a/src/etc/netplug/linkup.d/vyos-python-helper b/src/etc/netplug/linkup.d/vyos-python-helper deleted file mode 100755 index 9c59c58ad..000000000 --- a/src/etc/netplug/linkup.d/vyos-python-helper +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -PYTHON3=$(which python3) -# Call the real python script and forward commandline arguments -$PYTHON3 /etc/netplug/vyos-netplug-dhcp-client "${@:1}" -- cgit v1.2.3