#!/bin/bash
########## sw1 ##########
-ip link add name sw1-eth1 type veth peer name fw1-eth0
ip link add name sw1-eth2 type veth peer name fw2-eth0
ip link add name sw1-eth3 type veth peer name sw3-eth1
########## sw4 ##########
#ip link add name sw4-eth1 type veth peer name sw3-eth3
-########## fw1 ##########
-ip netns add fw1
-ip link set fw1-eth0 netns fw1
-
########## fw2 ##########
ip netns add fw2
ip link set fw2-eth0 netns fw2
ip link set cache1-eth0 netns cache1
########## sw1 ##########
-ofdatapath -i sw1-eth1,sw1-eth2,sw1-eth3 punix:/tmp/sw1 -d 000000000001 1> /tmp/sw1-ofd.log 2> /tmp/sw1-ofd.log &
+ofdatapath -i eth0,sw1-eth2,sw1-eth3 punix:/tmp/sw1 -d 000000000001 1> /tmp/sw1-ofd.log 2> /tmp/sw1-ofd.log &
ofprotocol unix:/tmp/sw1 tcp:127.0.0.1:6633 --fail=closed --listen=ptcp:6661 1> /tmp/sw1-ofp.log 2> /tmp/sw1-ofp.log &
########## sw2 ##########
ofdatapath -i sw4-eth1,eth3 punix:/tmp/sw4 -d 000000000004 1> /tmp/sw4-ofd.log 2> /tmp/sw4-ofd.log &
ofprotocol unix:/tmp/sw4 tcp:127.0.0.1:6633 --fail=closed --listen=ptcp:6664 1> /tmp/sw4-ofp.log 2> /tmp/sw4-ofp.log &
-sleep 5
-
-########## lldp ##########
-dpctl unix:/tmp/sw1 flow-mod cmd=add,table=0 eth_type=0x88cc apply:output=ctrl:0xff
-dpctl unix:/tmp/sw2 flow-mod cmd=add,table=0 eth_type=0x88cc apply:output=ctrl:0xff
-dpctl unix:/tmp/sw3 flow-mod cmd=add,table=0 eth_type=0x88cc apply:output=ctrl:0xff
-dpctl unix:/tmp/sw4 flow-mod cmd=add,table=0 eth_type=0x88cc apply:output=ctrl:0xff
-
exit 0