Commit c6e1a477 authored by Your Name's avatar Your Name

Add scripts to run OSPF+SR+SDN. OVS not running OSFP yet

parent 845d7eae
Scripts to run Free Range Routing's OSPF on profile sripv6-v3 in PhantomNet (https://www.phantomnet.org/show-profile.php?uuid=dfcfe493-56a9-11e7-91c5-90e2ba22fee4)
------------------------------------------------------------------------------------
A. How to set up basic IPv6 with OSPF? Everything is running on Node1.
---------------------------------------------------------------------
1. Obtain interfaces information by: ./get_all_info.sh. Result is in net_info.sh
2. Add global IPv6 addresses to interfaces: ./add_global_ipv6.sh
3. Create and install configuration files for FRR's Zebra and OSPF6. The configuration is copied to /usr/local/etc/ on each node after running the command:
./create_all_zebra_conf.sh
./create_all_ospf_conf.sh
4. Run FRR on node 2, 3, 4:
./start_all_frr.sh
5. After several seconds, the routes are populated by OSPF. Check routes on node 2,3,4 using:
ip -6 route
6. Install default routes on the end hosts: node1 and node 5
./install_default_route_on_hosts.sh
B. Run OVS with SR:
-------------------
1. Install ovs's kernel module: cd /opt/openvswitch; sudo ./re_compile.sh
2. Run OVS: cd /opt/openvswitch; sudo ./run_ovs.sh
3. Create ports for OVS: cd /opt/openvswitch; sudo ./run_srv6.sh <inport network (facing endhost)> <outport network (facing CR)> <controller's IP (node1's public IP)>
4. Show the ports of OVS by: cd /opt/openvswitch; sudo ./ovs_port_desc.sh
5. The OVS will try to connect to the Ryu's SDN controller at node1.
C. Run Ryu SDN controller:
--------------------------
0. Modify the parameters in the controller to match the information in net_info.sh.
1. cd /opt/openvswitch/sdn_controller/; ryu-manager sr_controller_test.py
2. The controller will install SR encapsulation rules on node1 and node5 OVSes.
D. Test connectivity:
--------------------
After the controller installs the rules, node0 should be able to ping node6's net2
ping6 <node6's net2 IP>
Other scripts:
--------------
1. kill_frr.sh: kill zebra and ospf deamons on a OSPF router.
2. start_frr.sh: start zebra and ospf deamons on a OSPF router.
3. zebra/ospf.log: log files of zebra and ospf.
4. other scripts are irrelevant, park here now for later use.
#!/bin/bash
source net_info.sh
SSH_SD="ssh -t -t"
DOMAIN=$(hostname | awk -F'.' '{print $2"."$3"."$4"."$5}')
#----------node0---------
echo "Add IPv6 addresses on node 0"
$SSH_SD "node0.$DOMAIN" "sudo ip -6 addr add $n0_1 dev $n0_1_dev"
#$SSH_SD "node1.$DOMAIN" "sudo ip -6 addr add $n1_lb dev lo"
#----------node1---------
#echo "Add IPv6 addresses on node 1"
#$SSH_SD "node1.$DOMAIN" "sudo ip -6 addr add $n1_a dev $n1_a_dev"
#$SSH_SD "node1.$DOMAIN" "sudo ip -6 addr add $n1_lb dev lo"
#----------node2---------
echo "Add IPv6 addresses on node 2"
#$SSH_SD "node2.$DOMAIN" "sudo ip -6 addr add $n2_a dev $n2_a_dev"
#$SSH_SD "node2.$DOMAIN" "sudo ip -6 addr add $n2_b dev $n2_b_dev"
#$SSH_SD "node2.$DOMAIN" "sudo ip -6 addr add $n2_c dev $n2_c_dev"
$SSH_SD "node2.$DOMAIN" "sudo ip -6 addr add $n2_lb dev lo"
#----------node3---------
echo "Add IPv6 addresses on node 3"
#$SSH_SD "node3.$DOMAIN" "sudo ip -6 addr add $n3_b dev $n3_b_dev"
#$SSH_SD "node3.$DOMAIN" "sudo ip -6 addr add $n3_d dev $n3_d_dev"
#$SSH_SD "node3.$DOMAIN" "sudo ip -6 addr add $n3_e dev $n3_e_dev"
$SSH_SD "node3.$DOMAIN" "sudo ip -6 addr add $n3_lb dev lo"
#----------node4---------
echo "Add IPv6 addresses on node 4"
#$SSH_SD "node4.$DOMAIN" "sudo ip -6 addr add $n4_d dev $n4_d_dev"
#$SSH_SD "node4.$DOMAIN" "sudo ip -6 addr add $n4_c dev $n4_c_dev"
$SSH_SD "node4.$DOMAIN" "sudo ip -6 addr add $n4_lb dev lo"
#----------node5---------
#echo "Add IPv6 addresses on node 5"
#$SSH_SD "node5.$DOMAIN" "sudo ip -6 addr add $n5_e dev $n5_e_dev"
#$SSH_SD "node5.$DOMAIN" "sudo ip -6 addr add $n5_lb dev lo"
#----------node6---------
echo "Add IPv6 addresses on node 6"
$SSH_SD "node6.$DOMAIN" "sudo ip -6 addr add $n6_2 dev $n6_2_dev"
#$SSH_SD "node5.$DOMAIN" "sudo ip -6 addr add $n5_lb dev lo"
#!/bin/bash
hn=$(hostname)
domain=$(echo $hn | awk -F'.' '{print $2"."$3"."$4"."$5}')
for i in 1 2 3 4 5
do
echo -e "\n========================="
echo "Create OSPF conf of node $i ..."
scp net_info.sh create_ospf_conf.sh node$i.$domain:~/ > /dev/null
ssh node$i.$domain "./create_ospf_conf.sh"
done
echo "DONE installing OSPF6 conf files on all nodes!"
exit 0
#!/bin/bash
hn=$(hostname)
domain=$(echo $hn | awk -F'.' '{print $2"."$3"."$4"."$5}')
for i in 1 2 3 4 5
do
echo -e "\n=========================="
echo "Create zebra conf of node $i ..."
scp net_info.sh create_zebra_conf.sh node$i.$domain:~/ > /dev/null
ssh node$i.$domain "./create_zebra_conf.sh"
done
echo "DONE installing Zebra conf files on all nodes!"
exit 0
#!/bin/bash
source net_info.sh
OSPF="ospf6d.conf"
ETC="/usr/local/etc/"
META="hostname ospf6d@plant\npassword zebra\nlog file ospf6.log\nservice advanced-vty\n!"
echo "!" > $OSPF
echo -e $META >> $OSPF
#NODE1
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node1" ]; then
echo "#Node $hn..."
echo "interface $n1_a_dev" >> $OSPF
echo "interface $n1_1_dev" >> $OSPF
echo "interface lo" >> $OSPF
echo "router ospf6" >> $OSPF
echo " router-id 0.0.0.2" >> $OSPF
echo " area 0.0.0.0 range $n1_a/80" >> $OSPF
echo " interface $n1_a_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n1_1/80" >> $OSPF
echo " interface $n1_1_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n1_lb/80" >> $OSPF
echo " interface lo area 0.0.0.0" >> $OSPF
fi
#NODE2
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node2" ]; then
echo "#Node $hn..."
echo "interface $n2_a_dev" >> $OSPF
echo "interface $n2_b_dev" >> $OSPF
echo "interface $n2_c_dev" >> $OSPF
echo "interface lo" >> $OSPF
echo "router ospf6" >> $OSPF
echo " router-id 0.0.0.2" >> $OSPF
echo " area 0.0.0.0 range $n2_a/80" >> $OSPF
echo " interface $n2_a_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n2_b/80" >> $OSPF
echo " interface $n2_b_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n2_c/80" >> $OSPF
echo " interface $n2_c_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n2_lb/80" >> $OSPF
echo " interface lo area 0.0.0.0" >> $OSPF
fi
#NODE3
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node3" ]; then
echo "#Node $hn..."
echo "interface $n3_b_dev" >> $OSPF
echo "interface $n3_d_dev" >> $OSPF
echo "interface $n3_e_dev" >> $OSPF
echo "interface lo" >> $OSPF
echo "router ospf6" >> $OSPF
echo " router-id 0.0.0.3" >> $OSPF
echo " area 0.0.0.0 range $n3_b/80" >> $OSPF
echo " interface $n3_b_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n3_d/80" >> $OSPF
echo " interface $n3_d_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n3_e/80" >> $OSPF
echo " interface $n3_e_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n3_lb/80" >> $OSPF
echo " interface lo area 0.0.0.0" >> $OSPF
fi
#NODE4
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node4" ]; then
echo "#Node $hn..."
echo "interface $n4_c_dev" >> $OSPF
echo "interface $n4_d_dev" >> $OSPF
echo "interface lo" >> $OSPF
echo "router ospf6" >> $OSPF
echo " router-id 0.0.0.4" >> $OSPF
echo " area 0.0.0.0 range $n4_c/80" >> $OSPF
echo " interface $n4_c_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n4_d/80" >> $OSPF
echo " interface $n4_d_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n4_lb/80" >> $OSPF
echo " interface lo area 0.0.0.0" >> $OSPF
fi
#NODE5
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node5" ]; then
echo "#Node $hn..."
echo "interface $n5_e_dev" >> $OSPF
echo "interface $n5_2_dev" >> $OSPF
echo "interface lo" >> $OSPF
echo "router ospf6" >> $OSPF
echo " router-id 0.0.0.2" >> $OSPF
echo " area 0.0.0.0 range $n5_e/80" >> $OSPF
echo " interface $n5_e_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n5_2/80" >> $OSPF
echo " interface $n5_2_dev area 0.0.0.0" >> $OSPF
echo " area 0.0.0.0 range $n5_lb/80" >> $OSPF
echo " interface lo area 0.0.0.0" >> $OSPF
fi
echo "line vty" >> $OSPF
cat $OSPF
sudo cp $OSPF $ETC
exit 0
#!/bin/bash
source net_info.sh
ZEBRA="zebra.conf"
ETC="/usr/local/etc/"
META="hostname Router\n
password zebra\n
enable password zebra\n
log file zebra.log\n!"
#LB="interface lo\n
LB="ip forwarding\n
line vty"
echo "!" > $ZEBRA
echo -e $META >> $ZEBRA
#NODE1
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node1" ]; then
echo "#Node $hn..."
echo "interface $n1_a_dev" >> $ZEBRA
echo " ipv6 address $n1_a/80" >> $ZEBRA
echo "interface $n1_1_dev" >> $ZEBRA
echo " ipv6 address $n1_1/80" >> $ZEBRA
echo "interface lo" >> $ZEBRA
echo " ipv6 address $n1_lb/80" >> $ZEBRA
fi
#NODE2
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node2" ]; then
echo "#Node $hn..."
echo "interface $n2_a_dev" >> $ZEBRA
echo " ipv6 address $n2_a/80" >> $ZEBRA
echo "interface $n2_b_dev" >> $ZEBRA
echo " ipv6 address $n2_b/80" >> $ZEBRA
echo "interface $n2_c_dev" >> $ZEBRA
echo " ipv6 address $n2_c/80" >> $ZEBRA
echo "interface lo" >> $ZEBRA
echo " ipv6 address $n2_lb/80" >> $ZEBRA
fi
#NODE3
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node3" ]; then
echo "#Node $hn..."
echo "interface $n3_b_dev" >> $ZEBRA
echo " ipv6 address $n3_b/80" >> $ZEBRA
echo "interface $n3_d_dev" >> $ZEBRA
echo " ipv6 address $n3_d/80" >> $ZEBRA
echo "interface $n3_e_dev" >> $ZEBRA
echo " ipv6 address $n3_e/80" >> $ZEBRA
echo "interface lo" >> $ZEBRA
echo " ipv6 address $n3_lb/80" >> $ZEBRA
fi
#NODE4
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node4" ]; then
echo "#Node $hn..."
echo "interface $n4_c_dev" >> $ZEBRA
echo " ipv6 address $n4_c/80" >> $ZEBRA
echo "interface $n4_d_dev" >> $ZEBRA
echo " ipv6 address $n4_d/80" >> $ZEBRA
echo "interface lo" >> $ZEBRA
echo " ipv6 address $n4_lb/80" >> $ZEBRA
fi
#NODE5
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node5" ]; then
echo "#Node $hn..."
echo "interface $n5_e_dev" >> $ZEBRA
echo " ipv6 address $n5_e/80" >> $ZEBRA
echo "interface $n5_2_dev" >> $ZEBRA
echo " ipv6 address $n5_2/80" >> $ZEBRA
echo "interface lo" >> $ZEBRA
echo " ipv6 address $n5_lb/80" >> $ZEBRA
fi
echo -e $LB >> $ZEBRA
cat $ZEBRA
sudo cp $ZEBRA $ETC
exit 0
#!/bin/bash
source net_info.sh
SSH_SD="ssh -t -t"
#Node name for SSH
DOMAIN=$(hostname | awk -F'.' '{print $2"."$3"."$4"."$5}')
INGRESS_NODES=("node2" "node3")
DST_IPS=($n5_e $n1_a)
#----------node2 (ingress)-------------
echo ""
echo "Delete SR rules on ingress nodes "${INGRESS_NODES[@]}""
echo "--------------------------------------"
#ip forwarding for pkts to DST_IP
$SSH_SD ${INGRESS_NODES[0]}.$DOMAIN "sudo ip -6 route del ${DST_IPS[0]}/128"
$SSH_SD ${INGRESS_NODES[1]}.$DOMAIN "sudo ip -6 route del ${DST_IPS[1]}/128"
#!/bin/bash
source net_info.sh
SSH_SD="ssh -t -t"
#Node name for SSH
DOMAIN=$(hostname | awk -F'.' '{print $2"."$3"."$4"."$5}')
SRC_NODE="node5.$DOMAIN"
INGRESS_NODE="node3.$DOMAIN"
#IP and interfaces
DST_IP=$n1_a
#segments
MID_SEGS=("$n4_d" "$n2_c") #via node3's netd adjacency and node2.
MID_SEG_DEVS="$n3_d_dev"
#----------node3 (ingress)-------------
echo ""
echo "Install rules on ingress nodes $INGRESS_NODE"
echo "--------------------------------------"
#ip forwarding for pkts to DST_IP
$SSH_SD $INGRESS_NODE "sudo ip -6 route add $DST_IP/128 dev $MID_SEG_DEVS encap seg6 mode encap segs ${MID_SEGS[0]},${MID_SEGS[1]}"
#!/bin/bash
source net_info.sh
SSH_SD="ssh -t -t"
#Node name for SSH
DOMAIN=$(hostname | awk -F'.' '{print $2"."$3"."$4"."$5}')
SRC_NODE="node5.$DOMAIN"
INGRESS_NODE="node3.$DOMAIN"
#IP and interfaces
DST_IP=$n1_a
#segments
MID_SEGS=("$n2_lb") #via node3's netd adjacency and node2.
MID_SEG_DEVS="$n3_b_dev" #this is bogus. But the ip route command seems to need this to pass the format check.
#----------node3 (ingress)-------------
echo ""
echo "Install rules on ingress nodes $INGRESS_NODE"
echo "--------------------------------------"
#ip forwarding for pkts to DST_IP
$SSH_SD $INGRESS_NODE "sudo ip -6 route add $DST_IP/128 dev $MID_SEG_DEVS encap seg6 mode encap segs ${MID_SEGS[0]}"
#!/bin/bash
#Install forwarding flags on OSPF routers to enable Segment Routing.
#
#Topology:
#
# |---(netb)---node3----(nete)---node5
# node1---(neta)---node2 --| |
# | |
# | (netd)
# | |
# |---(netc)---node4
#
source net_info.sh
SSH_SD="ssh -t -t"
#Node name for SSH
DOMAIN=$(hostname | awk -F'.' '{print $2"."$3"."$4"."$5}')
#----------node2-------------
echo ""
echo "Enable SR flags on router node2"
echo "--------------------------------------"
#enable IPV6 forwarding
$SSH_SD node2.$DOMAIN "sudo sysctl net.ipv6.conf.all.forwarding=1"
#enable SRH processing flag on node
$SSH_SD node2.$DOMAIN "sudo sysctl net.ipv6.conf.all.seg6_enabled=1"
#enable SRH processing flag on interfaces
$SSH_SD node2.$DOMAIN "sudo sysctl net.ipv6.conf.$n2_a_dev.seg6_enabled=1"
$SSH_SD node2.$DOMAIN "sudo sysctl net.ipv6.conf.$n2_b_dev.seg6_enabled=1"
$SSH_SD node2.$DOMAIN "sudo sysctl net.ipv6.conf.$n2_c_dev.seg6_enabled=1"
#----------node3-------------
echo ""
echo "Enable SR flags on router node3"
echo "--------------------------------------"
#enable IPV6 forwarding
$SSH_SD node3.$DOMAIN "sudo sysctl net.ipv6.conf.all.forwarding=1"
#enable SRH processing flag on node
$SSH_SD node3.$DOMAIN "sudo sysctl net.ipv6.conf.all.seg6_enabled=1"
#enable SRH processing flag on interface
$SSH_SD node3.$DOMAIN "sudo sysctl net.ipv6.conf.$n3_b_dev.seg6_enabled=1"
$SSH_SD node3.$DOMAIN "sudo sysctl net.ipv6.conf.$n3_d_dev.seg6_enabled=1"
$SSH_SD node3.$DOMAIN "sudo sysctl net.ipv6.conf.$n3_e_dev.seg6_enabled=1"
#--------node4--------------
echo ""
echo "Enable SR flags on router node4"
echo "--------------------------------------"
#enable IPV6 forwarding
$SSH_SD node4.$DOMAIN "sudo sysctl net.ipv6.conf.all.forwarding=1"
#enable SRH processing flag on node
$SSH_SD node4.$DOMAIN "sudo sysctl net.ipv6.conf.all.seg6_enabled=1"
#enable SRH processing flag on interface
$SSH_SD node4.$DOMAIN "sudo sysctl net.ipv6.conf.$n4_c_dev.seg6_enabled=1"
$SSH_SD node4.$DOMAIN "sudo sysctl net.ipv6.conf.$n4_d_dev.seg6_enabled=1"
#!/bin/bash
#deploy and run myself
echo "#!/bin/bash" > net_info.sh
hn=$(hostname)
domain=$(echo $hn | awk -F'.' '{print $2"."$3"."$4"."$5}')
echo "Get info of node $hn ..."
./get_info.sh >> net_info.sh
for i in 0 2 3 4 5 6
do
echo "Get info of node $i ..."
scp get_info.sh node$i.$domain:~/ > /dev/null
ssh node$i.$domain "./get_info.sh" >> net_info.sh
done
echo "DONE. See net_info.sh"
#!/bin/bash
LB_IP=197
INF="/proj/PhantomNet/binh/simeca_scripts/get_interface_map.pl"
#NODE0
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node0" ]; then
echo "#Node $hn..."
n0_1_dev=$($INF | grep net1 | awk '{print $3}')
n0_1_mac=$(ifconfig | grep $n0_1_dev | awk '{print $5}')
n0_1=$(ifconfig | grep -A3 $n0_1_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::203:/ )
let lb=$LB_IP+0
echo "n0_lb=\"$lb::1\""
echo "n0_1=\"$n0_1\""
echo "n0_1_mac=\"$n0_1_mac\""
echo "n0_1_dev=\"$n0_1_dev\""
fi
#NODE1
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node1" ]; then
echo "#Node $hn..."
n1_a_dev=$($INF | grep neta | awk '{print $3}')
n1_a_mac=$(ifconfig | grep $n1_a_dev | awk '{print $5}')
n1_a=$(ifconfig | grep -A3 $n1_a_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::204:/ )
n1_1_dev=$($INF | grep net1 | awk '{print $3}')
n1_1_mac=$(ifconfig | grep $n1_1_dev | awk '{print $5}')
n1_1=$(ifconfig | grep -A3 $n1_1_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::203:/ )
let lb=$LB_IP+1
echo "n1_lb=\"$lb::1\""
echo "n1_a=\"$n1_a\""
echo "n1_a_mac=\"$n1_a_mac\""
echo "n1_a_dev=\"$n1_a_dev\""
echo "n1_1=\"$n1_1\""
echo "n1_1_mac=\"$n1_1_mac\""
echo "n1_1_dev=\"$n1_1_dev\""
fi
#NODE2
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node2" ]; then
echo "#Node $hn..."
n2_a_dev=$($INF | grep neta | awk '{print $3}')
n2_a_mac=$(ifconfig | grep $n2_a_dev | awk '{print $5}')
n2_a=$(ifconfig | grep -A3 $n2_a_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::204:/ )
n2_b_dev=$($INF | grep netb | awk '{print $3}')
n2_b_mac=$(ifconfig | grep $n2_b_dev | awk '{print $5}')
n2_b=$(ifconfig | grep -A3 $n2_b_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::205:/ )
n2_c_dev=$($INF | grep netc | awk '{print $3}')
n2_c_mac=$(ifconfig | grep $n2_c_dev | awk '{print $5}')
n2_c=$(ifconfig | grep -A3 $n2_c_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::206:/ )
let lb=$LB_IP+2
echo "n2_lb=\"$lb::1\""
echo "n2_a=\"$n2_a\""
echo "n2_a_mac=\"$n2_a_mac\""
echo "n2_a_dev=\"$n2_a_dev\""
echo "n2_b=\"$n2_b\""
echo "n2_b_mac=\"$n2_b_mac\""
echo "n2_b_dev=\"$n2_b_dev\""
echo "n2_c=\"$n2_c\""
echo "n2_c_mac=\"$n2_c_mac\""
echo "n2_c_dev=\"$n2_c_dev\""
fi
#NODE3
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node3" ]; then
echo "#Node $hn..."
n3_b_dev=$($INF | grep netb | awk '{print $3}')
n3_b_mac=$(ifconfig | grep $n3_b_dev | awk '{print $5}')
n3_b=$(ifconfig | grep -A3 $n3_b_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::205:/ )
n3_d_dev=$($INF | grep netd | awk '{print $3}')
n3_d_mac=$(ifconfig | grep $n3_d_dev | awk '{print $5}')
n3_d=$(ifconfig | grep -A3 $n3_d_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::207:/ )
n3_e_dev=$($INF | grep nete | awk '{print $3}')
n3_e_mac=$(ifconfig | grep $n3_e_dev | awk '{print $5}')
n3_e=$(ifconfig | grep -A3 $n3_e_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::208:/ )
let lb=$LB_IP+3
echo "n3_lb=\"$lb::1\""
echo "n3_b=\"$n3_b\""
echo "n3_b_mac=\"$n3_b_mac\""
echo "n3_b_dev=\"$n3_b_dev\""
echo "n3_d=\"$n3_d\""
echo "n3_d_mac=\"$n3_d_mac\""
echo "n3_d_dev=\"$n3_d_dev\""
echo "n3_e=\"$n3_e\""
echo "n3_e_mac=\"$n3_e_mac\""
echo "n3_e_dev=\"$n3_e_dev\""
fi
#NODE4
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node4" ]; then
echo "#Node $hn..."
n4=$($INF)
n4_c_dev=$($INF | grep netc | awk '{print $3}')
n4_c_mac=$(ifconfig | grep $n4_c_dev | awk '{print $5}')
n4_c=$(ifconfig | grep -A3 $n4_c_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::206:/ )
n4_d_dev=$($INF | grep netd | awk '{print $3}')
n4_d_mac=$(ifconfig | grep $n4_d_dev | awk '{print $5}')
n4_d=$(ifconfig | grep -A3 $n4_d_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*/2001::207:/ )
let lb=$LB_IP+4
echo "n4_lb=\"$lb::1\""
echo "n4_c=\"$n4_c\""
echo "n4_c_mac=\"$n4_c_mac\""
echo "n4_c_dev=\"$n4_c_dev\""
echo "n4_d=\"$n4_d\""
echo "n4_d_mac=\"$n4_d_mac\""
echo "n4_d_dev=\"$n4_d_dev\""
fi
#NODE5
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node5" ]; then
echo "#Node $hn..."
n5_e_dev=$($INF | grep nete | awk '{print $3}')
n5_e_mac=$(ifconfig | grep $n5_e_dev | awk '{print $5}')
n5_e=$(ifconfig | grep -A3 $n5_e_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::208:/ )
n5_2_dev=$($INF | grep net2 | awk '{print $3}')
n5_2_mac=$(ifconfig | grep $n5_2_dev | awk '{print $5}')
n5_2=$(ifconfig | grep -A3 $n5_2_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::209:/ )
let lb=$LB_IP+5
echo "n5_lb=\"$lb::1\""
echo "n5_e=\"$n5_e\""
echo "n5_e_mac=\"$n5_e_mac\""
echo "n5_e_dev=\"$n5_e_dev\""
echo "n5_2=\"$n5_2\""
echo "n5_2_mac=\"$n5_2_mac\""
echo "n5_2_dev=\"$n5_2_dev\""
fi
#NODE6
hn=$(hostname | awk -F'.' '{print $1}')
if [ "$hn" == "node6" ]; then
echo "#Node $hn..."
n6_2_dev=$($INF | grep net2 | awk '{print $3}')
n6_2_mac=$(ifconfig | grep $n6_2_dev | awk '{print $5}')
n6_2=$(ifconfig | grep -A3 $n6_2_dev | grep inet6 | grep "fe80::" | awk '{print $3}' | awk -F'/' '{print $1}' | sed s/fe80::*:/2001::209:/ )
let lb=$LB_IP+6
echo "n6_lb=\"$lb::1\""
echo "n6_2=\"$n6_2\""
echo "n6_2_mac=\"$n6_2_mac\""
echo "n6_2_dev=\"$n6_2_dev\""
fi
#!/bin/bash
source net_info.sh
SSH_SD="ssh -t -t"
#Node name for SSH
DOMAIN=$(hostname | awk -F'.' '{print $2"."$3"."$4"."$5}')
$SSH_SD node0.$DOMAIN "sudo ip -6 route add $n6_2/80 dev $n0_1_dev"
$SSH_SD node0.$DOMAIN "sudo ip -6 neigh add $n6_2 lladdr $n1_1_mac dev $n0_1_dev"
$SSH_SD node0.$DOMAIN "sudo ip -6 neigh replace $n6_2 lladdr $n1_1_mac dev $n0_1_dev"
$SSH_SD node6.$DOMAIN "sudo ip -6 route add $n0_1/80 dev $n6_2_dev"
$SSH_SD node6.$DOMAIN "sudo ip -6 neigh add $n0_1 dev $n6_2_dev"
$SSH_SD node6.$DOMAIN "sudo ip -6 neigh replace $n0_1 lladdr $n5_2_mac dev $n6_2_dev"
#!/bin/bash
source net_info.sh
iperf -V -M 1350 -c $n5_e
#!/bin/bash
for i in zebra ospf6
do
ps ax | grep "$i" | grep -v "grep" | awk '{system("kill -9 " $1)}'
done
#!/bin/bash
#Node node1...
n1_lb="198::1"
n1_a="2001::204:204:23ff:feb7:3ea7"
n1_a_mac="00:04:23:b7:3e:a7"
n1_a_dev="eth3"
n1_1="2001::203:204:23ff:feb7:3ea6"
n1_1_mac="00:04:23:b7:3e:a6"
n1_1_dev="eth2"
#Node node0...
n0_lb="197::1"
n0_1="2001::203:204:23ff:feb7:1a0a"
n0_1_mac="00:04:23:b7:1a:0a"
n0_1_dev="enp9s4f0"
#Node node2...
n2_lb="199::1"
n2_a="2001::204:204:23ff:feb7:12da"
n2_a_mac="00:04:23:b7:12:da"
n2_a_dev="enp9s4f0"
n2_b="2001::205:204:23ff:feb7:12db"
n2_b_mac="00:04:23:b7:12:db"
n2_b_dev="enp9s4f1"
n2_c="2001::206:204:23ff:feb7:1311"
n2_c_mac="00:04:23:b7:13:11"
n2_c_dev="enp10s3f1"
#Node node3...
n3_lb="200::1"
n3_b="2001::205:204:23ff:feb7:2100"
n3_b_mac="00:04:23:b7:21:00"
n3_b_dev="enp9s4f0"
n3_d="2001::207:204:23ff:feb7:2101"
n3_d_mac="00:04:23:b7:21:01"
n3_d_dev="enp9s4f1"
n3_e="2001::208:204:23ff:feb7:1971"
n3_e_mac="00:04:23:b7:19:71"
n3_e_dev="enp10s3f1"
#Node node4...
n4_lb="201::1"
n4_c="2001::206:204:23ff:fea8:da63"
n4_c_mac="00:04:23:a8:da:63"
n4_c_dev="enp9s4f1"
n4_d="2001::207:204:23ff:fea8:da62"
n4_d_mac="00:04:23:a8:da:62"
n4_d_dev="enp9s4f0"
#Node node5...
n5_lb="202::1"
n5_e="2001::208:204:23ff:feb7:40a6"
n5_e_mac="00:04:23:b7:40:a6"
n5_e_dev="eth2"