Commit 81743090 authored by Binh Nguyen's avatar Binh Nguyen

SR paths: shortest path and higher bandwdith path

parent dd0d6565
Scripts to install SR for a topology in the phantomnet profile (sripv6-v2): https://www.phantomnet.org/show-profile.php?uuid=5596f45b-550e-11e7-ac8f-90e2ba22fee4
---------------------------------------------------
How to run?
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. Install routes for the topology (mimicking OSPF, but manually): ./install_routes.sh
4. Scenario 1: Install an longer SR path (mimicking adjacency segment at ingress node):
./del_sr.sh #delete existing segment routing rules.
./ul_adj.sh
./dl_adj.sh
PING from node 1 to node 5: ping6 -I <node1's neta interface> <node5's nete interface IP>
#!!!!!NOTE: IF using IPERF: need to set the Segment Size to around 1350B, if segment 1400B is used
node 2 can't receive packets from node 1.
5. Scenario 2: Install a shortes SR path (mimicking node segment at ingress node):
./del_sr.sh #delete existing segment routing rules.
./ul_node.sh
./dl_node.sh
PING from node 1 to node 5: ping6 -I <node1's neta interface> <node5's nete interface IP>
#!/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="node1.$DOMAIN"
MID_NODES=("node2.$DOMAIN" "node4.$DOMAIN")
EGRESS_NODE="node3.$DOMAIN"
#IP and interfaces
SRC_IP=$n1_a
SRC_MAC=$n1_a_mac
SRC_DEV=$n1_a_dev
DST_IP=$n5_e
DST_MAC=$n5_e_mac
DST_DEV=$n5_e_dev
#segments
MID_SEGS=("$n4_c" "$n3_lb") #via node2's netb adjacency and node3.
MID_SEG_MACS=("$n4_c_mac" "$n3_d_mac")
MID_SEG_DEVS=("$n2_c_dev" "$n4_d_dev")
MID_NODE_SRH_INFS=("$n2_a_dev" "$n4_c_dev")
#egress DEV (to destination)
EGRESS_DEV=$n3_e_dev
#egress DEV (receiving)
EGRESS_DEV_IN=$n3_d_dev
#----------node1-----------------
echo ""
echo "Install rules on source node $SRC_NODE"
echo "--------------------------------------"
#ip route to node 5:
$SSH_SD $SRC_NODE "sudo ip -6 route del $DST_IP/128 dev $SRC_DEV"
#arp to node 5 via node 2:
$SSH_SD $SRC_NODE "sudo ip -6 neigh del $DST_IP lladdr $n2_a_mac dev $SRC_DEV"
#----------node2 (ingress)-------------
echo ""
echo "Install rules on ingress nodes ${MID_NODES[0]}"
echo "--------------------------------------"
#ip forwarding for pkts to DST_IP
$SSH_SD ${MID_NODES[0]} "sudo ip -6 route del $DST_IP/128 dev ${MID_SEG_DEVS[0]} encap seg6 mode encap segs $MID_SEGS"
#arp for DST_IP
$SSH_SD ${MID_NODES[0]} "sudo ip -6 neigh del $DST_IP lladdr ${MID_SEG_MACS[0]} dev ${MID_SEG_DEVS[0]}"
#ip forwarding for pkts to next-hop (encapsulated pkt's destination)
$SSH_SD ${MID_NODES[0]} "sudo ip -6 route del ${MID_SEGS[0]}/128 dev ${MID_SEG_DEVS[0]}"
#----------node4 (core node)-------------
echo ""
echo "Install rules on core nodes ${MID_NODES[1]}"
echo "--------------------------------------"
#arp for the next segment (eg, node3's loopback)
$SSH_SD ${MID_NODES[0]} "sudo ip -6 neigh del ${MIG_SEGS[1]} lladdr ${MID_SEG_MACS[1]} dev ${MID_SEG_DEVS[1]}"
#ip forwarding for pkts to next-hop (encapsulated pkt's destination)
$SSH_SD ${MID_NODES[0]} "sudo ip -6 route del ${MID_SEGS[1]}/128 dev ${MID_SEG_DEVS[1]}"
#--------node3 (egress)--------------
echo ""
echo "Install rules on egress node $EGRESS_NODE"
echo "--------------------------------------"
#ip forwarding for pkts to DST_IP.
$SSH_SD $EGRESS_NODE "sudo ip -6 route del $DST_IP/128 dev $EGRESS_DEV"
#arp for DST_IP
$SSH_SD $EGRESS_NODE "sudo ip -6 neigh del $DST_IP lladdr $DST_MAC dev $EGRESS_DEV"
#!/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_b") #via node3's netd adjacency and node2.
MID_SEG_DEVS="$n3_b_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]}"
#!/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"
MID_NODES=("node4.$DOMAIN")
EGRESS_NODE="node2.$DOMAIN"
INGRESS_NODE="node3.$DOMAIN"
#IP and interfaces
SRC_IP=$n5_e
SRC_MAC=$n5_e_mac
SRC_DEV=$n5_e_dev
DST_IP=$n1_a
DST_MAC=$n1_a_mac
DST_DEV=$n1_a_dev
#segments
MID_SEGS=("$n4_d" "$n2_c") #via node3's netd adjacency and node2.
MID_SEG_MACS=("$n4_d_mac" "$n2_c_mac")
MID_SEG_DEVS=("$n3_d_dev" "$n4_c_dev")
MID_NODE_SRH_INFS=("$n4_d_dev")
INGRESS_INF="$n3_e_dev"
#egress DEV (to destination)
EGRESS_DEV=$n2_a_dev
#egress DEV (receiving)
EGRESS_DEV_IN=$n2_c_dev
#----------node5-----------------
echo ""
echo "Install rules on source node $SRC_NODE"
echo "--------------------------------------"
#ip route to node 1:
$SSH_SD $SRC_NODE "sudo ip -6 route add $DST_IP/128 dev $SRC_DEV"
#arp to node 1 via node 2:
$SSH_SD $SRC_NODE "sudo ip -6 neigh add $DST_IP lladdr $n3_e_mac dev $SRC_DEV"
#if rerun the arp assignment, need to use "replace"
$SSH_SD $SRC_NODE "sudo ip -6 neigh replace $DST_IP lladdr $n3_e_mac dev $SRC_DEV"
#----------node3 (ingress)-------------
echo ""
echo "Install rules on ingress nodes $INGRESS_NODE"
echo "--------------------------------------"
#enable IPV6 forwarding
$SSH_SD $INGRESS_NODE "sudo sysctl net.ipv6.conf.all.forwarding=1"
#enable SRH processing flag on node
$SSH_SD $INGRESS_NODE "sudo sysctl net.ipv6.conf.all.seg6_enabled=1"
#enable SRH processing flag on interface
$SSH_SD $INGRESS_NODE "sudo sysctl net.ipv6.conf.$INGRESS_INF.seg6_enabled=1"
#ip forwarding for pkts to DST_IP
$SSH_SD $INGRESS_NODE "sudo ip -6 route add $DST_IP/128 dev ${MID_SEG_DEVS[0]} encap seg6 mode encap segs ${MID_SEGS[0]},${MID_SEGS[1]}"
#arp for DST_IP
$SSH_SD $INGRESS_NODE "sudo ip -6 neigh add $DST_IP lladdr ${MID_SEG_MACS[0]} dev ${MID_SEG_DEVS[0]}"
#ip forwarding for pkts to next-hop (encapsulated pkt's destination)
$SSH_SD $INGRESS_NODE "sudo ip -6 route add ${MID_SEGS[0]}/128 dev ${MID_SEG_DEVS[0]}"
#----------node4 (core node)-------------
echo ""
echo "Install rules on core nodes ${MID_NODES[0]}"
echo "--------------------------------------"
#enable IPV6 forwarding
$SSH_SD ${MID_NODES[0]} "sudo sysctl net.ipv6.conf.all.forwarding=1"
#enable SRH processing flag on node
$SSH_SD ${MID_NODES[0]} "sudo sysctl net.ipv6.conf.all.seg6_enabled=1"
#enable SRH processing flag on interface
$SSH_SD ${MID_NODES[0]} "sudo sysctl net.ipv6.conf.${MID_NODE_SRH_INFS[0]}.seg6_enabled=1"
#arp for the next segment
$SSH_SD ${MID_NODES[0]} "sudo ip -6 neigh add ${MID_SEGS[1]} lladdr ${MID_SEG_MACS[1]} dev ${MID_SEG_DEVS[1]}"
#ip forwarding for pkts to next-hop (encapsulated pkt's destination)
$SSH_SD ${MID_NODES[0]} "sudo ip -6 route add ${MID_SEGS[1]}/128 dev ${MID_SEG_DEVS[1]}"
#--------node2 (egress)--------------
echo ""
echo "Install rules on egress node $EGRESS_NODE"
echo "--------------------------------------"
#enable IPV6 forwarding
$SSH_SD $EGRESS_NODE "sudo sysctl net.ipv6.conf.all.forwarding=1"
#enable SRH processing flag on node
$SSH_SD $EGRESS_NODE "sudo sysctl net.ipv6.conf.all.seg6_enabled=1"
#enable SRH processing flag on interface
$SSH_SD $EGRESS_NODE "sudo sysctl net.ipv6.conf.$EGRESS_DEV_IN.seg6_enabled=1"
#ip forwarding for pkts to DST_IP.
$SSH_SD $EGRESS_NODE "sudo ip -6 route add $DST_IP/128 dev $EGRESS_DEV"
#arp for DST_IP
$SSH_SD $EGRESS_NODE "sudo ip -6 neigh add $DST_IP lladdr $DST_MAC dev $EGRESS_DEV"
#!/bin/bash
#Install routes for each node in the topology. This should be done using a routing
#protocol such as OSPF or ISIS.
#
#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}')
#----------node1-----------------
echo ""
echo "Install routes on source node1"
echo "--------------------------------------"
#ip route to node 5:
$SSH_SD node1.$DOMAIN "sudo ip -6 route add $n5_e/128 dev $n1_a_dev"
#arp to node 5 via node 2:
$SSH_SD node1.$DOMAIN "sudo ip -6 neigh add $n5_e lladdr $n2_a_mac dev $n1_a_dev"
#if rerun the arp assignment, need to use "replace"
$SSH_SD node1.$DOMAIN "sudo ip -6 neigh replace $n5_e lladdr $n2_a_mac dev $n1_a_dev"
#----------node2-------------
echo ""
echo "Install routes on 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"
#arp for node5
$SSH_SD node2.$DOMAIN "sudo ip -6 neigh add $n5_e lladdr $n4_c_mac dev $n2_c_dev"
$SSH_SD node2.$DOMAIN "sudo ip -6 neigh add $n5_e lladdr $n3_b_mac dev $n2_b_dev"
$SSH_SD node2.$DOMAIN "sudo ip -6 neigh add $n1_a lladdr $n1_a_mac dev $n2_a_dev"
#ip forwarding for pkts to next-hop (encapsulated pkt's destination)
$SSH_SD node2.$DOMAIN "sudo ip -6 route add $n4_c/128 dev $n2_c_dev"
$SSH_SD node2.$DOMAIN "sudo ip -6 route add $n3_b/128 dev $n2_b_dev"
$SSH_SD node2.$DOMAIN "sudo ip -6 route add $n1_a/128 dev $n2_a_dev"
#----------node3-------------
echo ""
echo "Install routes on 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"
#arp for the next segment
$SSH_SD node3.$DOMAIN "sudo ip -6 neigh add $n1_a lladdr $n2_b_mac dev $n3_b_dev"
$SSH_SD node3.$DOMAIN "sudo ip -6 neigh add $n1_a lladdr $n4_d_mac dev $n3_d_dev"
#ip forwarding for pkts to next-hop (encapsulated pkt's destination)
$SSH_SD node3.$DOMAIN "sudo ip -6 route add $n2_b/128 dev $n3_b_dev"
$SSH_SD node3.$DOMAIN "sudo ip -6 route add $n4_d/128 dev $n3_d_dev"
$SSH_SD node3.$DOMAIN "sudo ip -6 route add $n5_e/128 dev $n3_e_dev"
#--------node4--------------
echo ""
echo "Install routes on 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"
#arp for the next segment
$SSH_SD node4.$DOMAIN "sudo ip -6 neigh add $n1_a lladdr $n2_c_mac dev $n4_c_dev"
$SSH_SD node4.$DOMAIN "sudo ip -6 neigh add $n5_e lladdr $n3_d_mac dev $n4_d_dev"
#ip forwarding for pkts to next-hop (encapsulated pkt's destination)
$SSH_SD node4.$DOMAIN "sudo ip -6 route add $n3_d/128 dev $n4_d_dev"
$SSH_SD node4.$DOMAIN "sudo ip -6 route add $n2_c/128 dev $n4_c_dev"
#----------node5-----------------
echo ""
echo "Install routes on source node5"
echo "--------------------------------------"
#ip route to node 1:
$SSH_SD node5.$DOMAIN "sudo ip -6 route add $n1_a/128 dev $n5_e_dev"
#arp to node 5 via node 2:
$SSH_SD node5.$DOMAIN "sudo ip -6 neigh add $n1_a lladdr $n3_e_mac dev $n5_e_dev"
#if rerun the arp assignment, need to use "replace"
$SSH_SD node5.$DOMAIN "sudo ip -6 neigh replace $n1_a lladdr $n3_e_mac dev $n5_e_dev"
#!/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="node1.$DOMAIN"
MID_NODES=("node4.$DOMAIN")
EGRESS_NODE="node3.$DOMAIN"
INGRESS_NODE="node2.$DOMAIN"
#IP and interfaces
SRC_IP=$n1_a
SRC_MAC=$n1_a_mac
SRC_DEV=$n1_a_dev
DST_IP=$n5_e
DST_MAC=$n5_e_mac
DST_DEV=$n5_e_dev
#segments
MID_SEGS=("$n4_c" "$n3_d") #via node2's netc adjacency and node4.
MID_SEG_MACS=("$n4_c_mac" "$n3_d_mac")
MID_SEG_DEVS=("$n2_c_dev" "$n4_d_dev")
MID_NODE_SRH_INFS=("$n4_c_dev")
INGRESS_INF="$n2_a_dev"
#egress DEV (to destination)
EGRESS_DEV=$n3_e_dev
#egress DEV (receiving)
EGRESS_DEV_IN=$n3_d_dev
#----------node1-----------------
echo ""
echo "Install rules on source node $SRC_NODE"
echo "--------------------------------------"
#ip route to node 5:
$SSH_SD $SRC_NODE "sudo ip -6 route add $DST_IP/128 dev $SRC_DEV"
#arp to node 5 via node 2:
$SSH_SD $SRC_NODE "sudo ip -6 neigh add $DST_IP lladdr $n2_a_mac dev $SRC_DEV"
#if rerun the arp assignment, need to use "replace"
$SSH_SD $SRC_NODE "sudo ip -6 neigh replace $DST_IP lladdr $n2_a_mac dev $SRC_DEV"
#----------node2 (ingress)-------------
echo ""
echo "Install rules on ingress nodes $INGRESS_NODE"
echo "--------------------------------------"
#enable IPV6 forwarding
$SSH_SD $INGRESS_NODE "sudo sysctl net.ipv6.conf.all.forwarding=1"
#enable SRH processing flag on node
$SSH_SD $INGRESS_NODE "sudo sysctl net.ipv6.conf.all.seg6_enabled=1"
#enable SRH processing flag on interface
$SSH_SD $INGRESS_NODE "sudo sysctl net.ipv6.conf.$INGRESS_INF.seg6_enabled=1"
#ip forwarding for pkts to DST_IP
$SSH_SD $INGRESS_NODE "sudo ip -6 route add $DST_IP/128 dev ${MID_SEG_DEVS[0]} encap seg6 mode encap segs ${MID_SEGS[0]},${MID_SEGS[1]}"
#arp for DST_IP
$SSH_SD $INGRESS_NODE "sudo ip -6 neigh add $DST_IP lladdr ${MID_SEG_MACS[0]} dev ${MID_SEG_DEVS[0]}"
#ip forwarding for pkts to next-hop (encapsulated pkt's destination)
$SSH_SD $INGRESS_NODE "sudo ip -6 route add ${MID_SEGS[0]}/128 dev ${MID_SEG_DEVS[0]}"
#----------node4 (core node)-------------
echo ""
echo "Install rules on core nodes ${MID_NODES[0]}"
echo "--------------------------------------"
#enable IPV6 forwarding
$SSH_SD ${MID_NODES[0]} "sudo sysctl net.ipv6.conf.all.forwarding=1"
#enable SRH processing flag on node
$SSH_SD ${MID_NODES[0]} "sudo sysctl net.ipv6.conf.all.seg6_enabled=1"
#enable SRH processing flag on interface
$SSH_SD ${MID_NODES[0]} "sudo sysctl net.ipv6.conf.${MID_NODE_SRH_INFS[0]}.seg6_enabled=1"
#arp for the next segment
$SSH_SD ${MID_NODES[0]} "sudo ip -6 neigh add ${MID_SEGS[1]} lladdr ${MID_SEG_MACS[1]} dev ${MID_SEG_DEVS[1]}"
#ip forwarding for pkts to next-hop (encapsulated pkt's destination)
$SSH_SD ${MID_NODES[0]} "sudo ip -6 route add ${MID_SEGS[1]}/128 dev ${MID_SEG_DEVS[1]}"
#--------node3 (egress)--------------
echo ""
echo "Install rules on egress node $EGRESS_NODE"
echo "--------------------------------------"
#enable IPV6 forwarding
$SSH_SD $EGRESS_NODE "sudo sysctl net.ipv6.conf.all.forwarding=1"
#enable SRH processing flag on node
$SSH_SD $EGRESS_NODE "sudo sysctl net.ipv6.conf.all.seg6_enabled=1"
#enable SRH processing flag on interface
$SSH_SD $EGRESS_NODE "sudo sysctl net.ipv6.conf.$EGRESS_DEV_IN.seg6_enabled=1"
#ip forwarding for pkts to DST_IP.
$SSH_SD $EGRESS_NODE "sudo ip -6 route add $DST_IP/128 dev $EGRESS_DEV"
#arp for DST_IP
$SSH_SD $EGRESS_NODE "sudo ip -6 neigh add $DST_IP lladdr $DST_MAC dev $EGRESS_DEV"
#!/bin/bash
source net_info.sh
iperf -u -V -c $n5_e -b 1000m
iperf -V -M 1350 -c $n5_e
#!/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="node1.$DOMAIN"
INGRESS_NODE="node2.$DOMAIN"
#IP and interfaces
DST_IP=$n5_e
#segments
MID_SEGS=("$n4_c" "$n3_d") #via node2's netc adjacency and node4.
MID_SEG_DEVS="$n2_c_dev"
#----------node2 (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="node1.$DOMAIN"
INGRESS_NODE="node2.$DOMAIN"
#IP and interfaces
DST_IP=$n5_e
#segments
MID_SEGS=("$n3_b") #via node3.
MID_SEG_DEVS="$n2_b_dev"
#----------node2 (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]}"
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