From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH] Macvtap initscript for green nic Date: Tue, 12 Apr 2016 20:02:37 +0200 Message-ID: <1460484157-648-2-git-send-email-jonatan.schlag@ipfire.org> In-Reply-To: <1460484157-648-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6662291677748574716==" List-Id: --===============6662291677748574716== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Jonatan Schlag --- src/initscripts/init.d/macvtap-green | 52 ++++++++++++++++++++++++++++++++++= ++ 1 file changed, 52 insertions(+) create mode 100644 src/initscripts/init.d/macvtap-green diff --git a/src/initscripts/init.d/macvtap-green b/src/initscripts/init.d/ma= cvtap-green new file mode 100644 index 0000000..2b0e1b1 --- /dev/null +++ b/src/initscripts/init.d/macvtap-green @@ -0,0 +1,52 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/bridge +# +# Description : Skript to use a macvtap device as green0.=20 +# The green0 nic is renamed to greennic0 +# +# Authors : Jonatan Schlag +# +# Version : 01.00 +# +# Notes : +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +case "${1}" in + start) + boot_mesg "Create macvtap device for green0..." + #set green nic down + ip link set green0 down + # rename green0 to greennic0 + ip link set green0 name greennic0 + # bring greennic0 up + ip link set greennic0 up + # create the macvtap device for green0=09 + ip link add link greennic0 green0 type macvlan mode bridge + #bring green0 up + ip link set green0 up + ;; + + stop) + boot_mesg "Remove macvtap device for green0..." + =09 + #bring both devices down + ip link set green0 down + ip link set greennic0 down + #remove the macvtap device + ip link del green0 + # rename the greennic0 to green0 + ip link set greennic0 name green0 + ;; + *) + echo "Usage: ${0} {start|stop}" + exit 1 + ;; +esac + +# End $rc_base/init.d/bridge + --=20 2.1.4 --===============6662291677748574716==--