Skip to content

Instantly share code, notes, and snippets.

@Palatis
Created December 19, 2025 02:50
Show Gist options
  • Select an option

  • Save Palatis/6d0b96487e823c53ae9273f850f6db2c to your computer and use it in GitHub Desktop.

Select an option

Save Palatis/6d0b96487e823c53ae9273f850f6db2c to your computer and use it in GitHub Desktop.
put yt6801 ethX in PROMISC when a macvlan/macvtap device is created
#!/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
SUBSYSTEM=="net", ACTION=="add|change", \
ENV{ID_NET_DRIVER}=="macvlan|macvtap", \
RUN+="/etc/udev/rules.d/yt6801-promisc.sh %k"
@Palatis
Copy link
Author

Palatis commented Dec 19, 2025

when creating macvlan / macvtap with Motorcomm 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 = yes for no reason.
both NetworkManager-dispatcher & networkd-dispatcher doesn't broadcast an event if the parent ethX is not up.

so we do it with udev...

put the files under /etc/udev/rules.d/, when a macvlan / macvtap device is created and it's parent device with driver yt6801, put the parent into promiscuous mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment