[projects/rc-scripts] - added support for selecting macvlan mode

adwol adwol at pld-linux.org
Fri Jun 9 11:44:05 CEST 2017


commit a61559d7fa89abeabab6dea65816db6c129406a2
Author: Adam Osuchowski <adwol at pld-linux.org>
Date:   Fri Jun 9 11:42:23 2017 +0200

    - added support for selecting macvlan mode

 lib/ifup                               | 2 +-
 sysconfig/interfaces/ifcfg-description | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/lib/ifup b/lib/ifup
index cac60cff..b0c03f57 100755
--- a/lib/ifup
+++ b/lib/ifup
@@ -85,7 +85,7 @@ fi
 
 if [ -n "$MACVLAN_DEV" -a -n "$MACVLAN_MACADDR" ]; then
 	ip link del link ${MACVLAN_DEV} ${DEVICE} type macvlan > /dev/null 2>&1
-	ip link add link ${MACVLAN_DEV} address ${MACVLAN_MACADDR} name ${DEVICE} type macvlan
+	ip link add link ${MACVLAN_DEV} address ${MACVLAN_MACADDR} name ${DEVICE} type macvlan ${MACVLAN_MODE:+mode $MACVLAN_MODE}
 fi
 
 # is this device available? (this catches PCMCIA devices for us)
diff --git a/sysconfig/interfaces/ifcfg-description b/sysconfig/interfaces/ifcfg-description
index 967b51ed..1629ce0d 100644
--- a/sysconfig/interfaces/ifcfg-description
+++ b/sysconfig/interfaces/ifcfg-description
@@ -89,6 +89,7 @@ if 	DEVICE=eth*; then
 	if macvlan
 		MACVLAN_DEV=<exitsting base interface eg. eth0>
 		MACVLAN_MACADDR=<desired hw address of new interface>
+		MACVLAN_MODE=<desired mode of new interface (private, vepa, bridge, passthru, source)>
 	fi
 	
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/a61559d7fa89abeabab6dea65816db6c129406a2



More information about the pld-cvs-commit mailing list