Created
December 19, 2025 02:50
-
-
Save Palatis/6d0b96487e823c53ae9273f850f6db2c to your computer and use it in GitHub Desktop.
put yt6801 ethX in PROMISC when a macvlan/macvtap device is created
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| IFACE=${1} | |
| PARENT="$(basename "$(readlink /sys/class/net/${IFACE}/lower_* 2>/dev/null)")" | |
| [ -z "$PARENT" ] && exit 0 | |
| DRIVER="$(basename "$(readlink /sys/class/net/$PARENT/device/driver 2>/dev/null)")" | |
| case "$DRIVER" in | |
| yt6801) | |
| /sbin/ip link set dev "$PARENT" promisc on | |
| ;; | |
| *) | |
| ;; | |
| esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SUBSYSTEM=="net", ACTION=="add|change", \ | |
| ENV{ID_NET_DRIVER}=="macvlan|macvtap", \ | |
| RUN+="/etc/udev/rules.d/yt6801-promisc.sh %k" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when creating
macvlan/macvtapwithMotorcomm Microelectronics. YT6801 Gigabit Ethernet Controller [1f0a:6801], the parent physical ethernet device should be put into promiscuous mode before the child device can receive packet.however NetworkManager doesn't do that even with
macvlan.promiscuous = yesfor no reason.both
NetworkManager-dispatcher&networkd-dispatcherdoesn't broadcast an event if the parentethXis not up.so we do it with udev...
put the files under
/etc/udev/rules.d/, when amacvlan/macvtapdevice is created and it's parent device with driveryt6801, put the parent into promiscuous mode.