3 #Disable all the running streams
4 vppctl packet-gen disable
6 #Initial configuration: run only two streams
7 vppctl packet-gen enable-stream dns1
8 vppctl packet-gen enable-stream dns2
12 #Rehash port numbers and re-run five streams every minute
14 vppctl packet-gen disable
21 #Update destination (vLB) IP
22 VLB_IPADDR=$(cat /opt/config/vlb_ipaddr.txt)
23 IPADDR1=$(cat /opt/config/local_private_ipaddr.txt)
24 sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns1
25 sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns2
26 sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns3
27 sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns4
28 sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns5
30 #Update source ports (make them random)
31 sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns1
32 sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns2
33 sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns3
34 sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns4
35 sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns5
37 vppctl exec /opt/dns_streams/stream_dns1
38 vppctl exec /opt/dns_streams/stream_dns2
39 vppctl exec /opt/dns_streams/stream_dns3
40 vppctl exec /opt/dns_streams/stream_dns4
41 vppctl exec /opt/dns_streams/stream_dns5
43 #Resume stream execution
44 vppctl packet-gen enable-stream dns1
45 vppctl packet-gen enable-stream dns2
46 vppctl packet-gen enable-stream dns3
47 vppctl packet-gen enable-stream dns4
48 vppctl packet-gen enable-stream dns5