Update vLB to Ubuntu 1604 and VPP 1707
[demo.git] / vnfs / vLB / scripts / add_dns.sh
1 #!/bin/bash
2
3 if [ ! "$#" -eq 1 ]
4 then
5   echo "Usage: ./add_dns.sh [remote DNS server]"
6   exit
7 fi
8
9 DNS_IPADDR=$1
10 IP_TO_PKTGEN_NET=$(cat /opt/config/ip_to_pktgen_net.txt)
11 IP_TO_DNS_NET=$(cat /opt/config/ip_to_dns_net.txt)
12 GRE_IPADDR=$(cat /opt/config/gre_ipaddr.txt)
13
14 #vppctl lb as $MY_PUBLIC_IP"/32" $DNS_IPADDR
15 vppctl lb as $IP_TO_PKTGEN_NET"/32" $DNS_IPADDR
16 GRE=$(vppctl create gre tunnel src $IP_TO_DNS_NET dst $DNS_IPADDR)
17 vppctl set int ip address $GRE $GRE_IPADDR"/24"
18 vppctl set int state $GRE up
19
20 # Update the number of vDNSs currently active
21 FD="/opt/VES/code/evel_training/VESreporting/active_dns.txt"
22 CURR_DNS=$(cat $FD)
23 let CURR_DNS=$CURR_DNS+1
24 echo $CURR_DNS > $FD