diff --git a/config/rootfiles/common/udev b/config/rootfiles/common/udev index 4d519544d..e1f4bd5fb 100644 --- a/config/rootfiles/common/udev +++ b/config/rootfiles/common/udev @@ -28,6 +28,7 @@ lib/udev #lib/udev/hwdb.d/60-keyboard.hwdb #lib/udev/init-net-rules.sh #lib/udev/mtd_probe +#lib/udev/network-hotplug-macvtap #lib/udev/network-hotplug-rename #lib/udev/network-hotplug-vlan #lib/udev/rule_generator.functions diff --git a/config/udev/60-net.rules b/config/udev/60-net.rules index e82320cfe..e031e7a1e 100644 --- a/config/udev/60-net.rules +++ b/config/udev/60-net.rules @@ -5,3 +5,6 @@ ACTION=="add", SUBSYSTEM=="net", PROGRAM="/lib/udev/network-hotplug-rename", RES # Call a script that will create all virtual devices for a parent device # that has just come up. ACTION=="add", SUBSYSTEM=="net", RUN+="/lib/udev/network-hotplug-vlan" + +# Call a script that will set up macvtap interfaces +ACTION=="add", SUBSYSTEM=="net", RUN+="/lib/udev/network-hotplug-macvtap" diff --git a/config/udev/network-hotplug-macvtap b/config/udev/network-hotplug-macvtap new file mode 100644 index 000000000..7f5da12cb --- /dev/null +++ b/config/udev/network-hotplug-macvtap @@ -0,0 +1,46 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2016 IPFire Team # +# # +############################################################################ + +[ -n "${INTERFACE}" ] || exit 2 + +PHYSICAL_INTERFACE="${INTERFACE}" +VIRTUAL_INTERFACE="${INTERFACE%phys}" +#VIRTUAL_INTERFACE="${VIRTUAL_INTERFACE}0" + +# Do nothing if the physical interface does not end with "phys" +case "${PHYSICAL_INTERFACE}" in + *phys) + ;; + *) + exit 0 + ;; +esac + +ADDRESS="$(