Commit 4449c823 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

set netns in the same command line

parent 75c59e24
......@@ -29,14 +29,12 @@ PID=$$
# A-br0-B
xunshare B -- ip link set lo up
xnsenter B -- ip link add ba type veth peer BA
xnsenter B -- ip link set BA netns $PID
xnsenter B -- ip link add ba type veth peer BA netns $PID
xnsenter B -- ip link set ba up
ip link set BA up
xunshare A -- ip link set lo up
xnsenter A -- ip link add ab type veth peer AB
xnsenter A -- ip link set AB netns $PID
xnsenter A -- ip link add ab type veth peer AB netns $PID
xnsenter A -- ip link set ab up
ip link set AB up
......@@ -46,14 +44,12 @@ ip link set AB master br0
ip link set br0 up
# A-br1-C
xnsenter A -- ip link add ac type veth peer AC
xnsenter A -- ip link set AC netns $PID
xnsenter A -- ip link add ac type veth peer AC netns $PID
xnsenter A -- ip link set ac up
ip link set AC up
xunshare C -- ip link set lo up
xnsenter C -- ip link add ca type veth peer CA
xnsenter C -- ip link set CA netns $PID
xnsenter C -- ip link add ca type veth peer CA netns $PID
xnsenter C -- ip link set ca up
ip link set CA up
......@@ -63,14 +59,12 @@ ip link set AC master br1
ip link set br1 up
# C-br2-D
xnsenter C -- ip link add cd type veth peer CD
xnsenter C -- ip link set CD netns $PID
xnsenter C -- ip link add cd type veth peer CD netns $PID
xnsenter C -- ip link set cd up
ip link set CD up
xunshare D -- ip link set lo up
xnsenter D -- ip link add dc type veth peer DC
xnsenter D -- ip link set DC netns $PID
xnsenter D -- ip link add dc type veth peer DC netns $PID
xnsenter D -- ip link set dc up
ip link set DC up
......@@ -80,13 +74,11 @@ ip link set DC master br2
ip link set br2 up
# B-br3-D
xnsenter B -- ip link add bd type veth peer BD
xnsenter B -- ip link set BD netns $PID
xnsenter B -- ip link add bd type veth peer BD netns $PID
xnsenter B -- ip link set bd up
ip link set BD up
xnsenter D -- ip link add db type veth peer DB
xnsenter D -- ip link set DB netns $PID
xnsenter D -- ip link add db type veth peer DB netns $PID
xnsenter D -- ip link set db up
ip link set DB up
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment