blob: 46abc6f4f679d708ea6398b2a26e011307418794 [file] [log] [blame]
Scott Feldman63d2ada2015-03-13 21:09:31 -07001simp destroy ".*"
2simp create -o sw1:rocker:sw1 tut tut.dot
3simp start tut
4sleep 10
5while ! simp ssh tut sw1 --cmd "ping -c 1 localhost >/dev/null"; do sleep 1; done
6while ! simp ssh tut h1 --cmd "ping -c 1 localhost >/dev/null"; do sleep 1; done
7while ! simp ssh tut h2 --cmd "ping -c 1 localhost >/dev/null"; do sleep 1; done
8
9# configure a 2-port bridge
10
11simp ssh tut sw1 --cmd "sudo /sbin/ip link add name br0 type bridge"
Scott Feldman73da0232015-06-10 18:21:19 -070012simp ssh tut sw1 --cmd "sudo /sbin/ip link set dev sw1p1 master br0"
13simp ssh tut sw1 --cmd "sudo /sbin/ip link set dev sw1p2 master br0"
Scott Feldman63d2ada2015-03-13 21:09:31 -070014
15# turn off vlan default_pvid on br0
16
17simp ssh tut sw1 --cmd "echo 0 | sudo dd of=/sys/class/net/br0/bridge/default_pvid 2> /dev/null"
18
19# turn off learning and flooding in SW
20
Scott Feldman73da0232015-06-10 18:21:19 -070021simp ssh tut sw1 --cmd "sudo /sbin/bridge link set dev sw1p1 learning off"
22simp ssh tut sw1 --cmd "sudo /sbin/bridge link set dev sw1p2 learning off"
Scott Feldman63d2ada2015-03-13 21:09:31 -070023
Scott Feldman73da0232015-06-10 18:21:19 -070024simp ssh tut sw1 --cmd "sudo /sbin/bridge link set dev sw1p1 flood off"
25simp ssh tut sw1 --cmd "sudo /sbin/bridge link set dev sw1p2 flood off"
Scott Feldman63d2ada2015-03-13 21:09:31 -070026
27# bring up bridge and ports
28
29simp ssh tut sw1 --cmd "sudo ifconfig br0 up"
Scott Feldman73da0232015-06-10 18:21:19 -070030simp ssh tut sw1 --cmd "sudo ifconfig sw1p1 up"
31simp ssh tut sw1 --cmd "sudo ifconfig sw1p2 up"
Scott Feldman63d2ada2015-03-13 21:09:31 -070032simp ssh tut sw1 --cmd "sudo ifconfig br0 11.0.0.3/24"
33
34# config IP on hosts
35
Scott Feldman73da0232015-06-10 18:21:19 -070036simp ssh tut h1 --cmd "sudo ifconfig sw1p1 11.0.0.1/24"
37simp ssh tut h2 --cmd "sudo ifconfig sw1p1 11.0.0.2/24"
Scott Feldman63d2ada2015-03-13 21:09:31 -070038
39# test...
40
41simp ssh tut h1 --cmd "ping -c10 11.0.0.2 >/dev/null"
42if [ $? -ne 0 ]; then exit 1; fi
43simp ssh tut h1 --cmd "ping -c10 11.0.0.3 >/dev/null"