git://git.onelab.eu
/
nodemanager-topo.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
77cc1d1ec68173667e63be4e796a7203c5475cc7
[nodemanager-topo.git]
/
teardown-egre-link
1
#!/bin/sh +x
2
3
SLICE=$1
4
SLICEID=`id -u $SLICE`
5
NODEID=$2
6
KEY=$3
7
8
LINK=${KEY}x${NODEID}
9
EGRE=d$LINK
10
BRIDGE=c$LINK
11
ETUN1=b$LINK
12
13
# Remove iptables rule
14
iptables -t mangle -D FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID
15
16
# Get rid of etun devices, only need name of one of them
17
echo $ETUN1 > /sys/module/etun/parameters/delif
18
19
# Get rid of bridge
20
ifconfig $BRIDGE down
21
brctl delbr $BRIDGE
22
23
# Get rid of EGRE tunnel
24
ip tunnel del $EGRE
25