Created
January 23, 2019 23:53
-
-
Save durd/c4793c62a138b814197d560dd1801399 to your computer and use it in GitHub Desktop.
vlan with systemd
This file contains 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
# /lib/udev/rules.d/ | |
# Allow rfkill for users in the netdev group | |
KERNEL=="rfkill", MODE="0664", GROUP="netdev" | |
# Handle allow-hotplug interfaces | |
SUBSYSTEM=="net", ACTION=="add|remove", RUN+="ifupdown-hotplug" | |
SUBSYSTEM=="net", RUN+="vlan-network-interface" |
This file contains 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
# /lib/udev/vlan-network-interface | |
#!/bin/sh | |
# vlan-network-interface - configure a network bridge | |
# | |
# This service checks whether a physical network device that has been added | |
# has VLAN defined in /etc/network/interfaces that should be brought up | |
set -e | |
if [ -z "$INTERFACE" ]; then | |
echo "missing \$INTERFACE" >&2 | |
exit 1 | |
fi | |
if ! which ifquery >/dev/null; then | |
exit 0 | |
fi | |
if [ ! -x /etc/network/if-pre-up.d/vlan ]; then | |
exit 0 | |
fi | |
mkdir -p /run/network | |
for IFACE in $(ifquery --list --allow auto); do | |
IF_VLAN_RAW_DEVICE=$(ifquery $IFACE | sed -n -e's/^vlan[_-]raw[_-]device: //p') | |
# Now that the environment is ready, call the pre-up script to create the vlan | |
export IFACE IF_VLAN_RAW_DEVICE | |
# Create the VLANs related to the interface | |
if [ "$IF_VLAN_RAW_DEVICE" = "$INTERFACE" ] || \ | |
echo $IFACE | grep -q $INTERFACE; then | |
/etc/network/if-pre-up.d/vlan | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
disable systemds networking.service.
still doesnt honor
/etc/dhcp/dhclient.conf
...