Change DNS stream payload
[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 $IP_TO_PKTGEN_NET"/32" $DNS_IPADDR
15 GRE=$(vppctl create gre tunnel src $IP_TO_DNS_NET dst $DNS_IPADDR)
16 vppctl set int ip address $GRE $GRE_IPADDR"/24"
17 vppctl set int state $GRE up
18
19 # Update the number of vDNSs currently active
20 FD="/opt/VES/code/evel_training/VESreporting/active_dns.txt"
21 CURR_DNS=$(cat $FD)
22 let CURR_DNS=$CURR_DNS+1
23 echo $CURR_DNS > $FD