diff options
author | Itohan <itohan.ukponmwan@intel.com> | 2017-11-01 20:44:37 -0700 |
---|---|---|
committer | Itohan <itohan.ukponmwan@intel.com> | 2017-11-01 20:53:09 -0700 |
commit | 70c65810123a86ec6b55bd2ed066ebd715b68636 (patch) | |
tree | 1658885ed74fa57b7dc92d9c3e94f2184b8467eb /vnfs/vCPE | |
parent | aadaadbe2f6ebd6bdd0281a1127221841b382769 (diff) |
Modified vbrg install script for sdnc config
Modified script to include sdnc routing and
arp configurations
Change-Id: I510a8abd11dc6df0d5cedc657d6229a1fd243f59
Issue-ID: INT-63
Signed-off-by: Itohan <itohan.ukponmwan@intel.com>
Diffstat (limited to 'vnfs/vCPE')
-rwxr-xr-x | vnfs/vCPE/scripts/v_brgemu_install.sh | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/vnfs/vCPE/scripts/v_brgemu_install.sh b/vnfs/vCPE/scripts/v_brgemu_install.sh index 94ed76d2..a0a16c76 100755 --- a/vnfs/vCPE/scripts/v_brgemu_install.sh +++ b/vnfs/vCPE/scripts/v_brgemu_install.sh @@ -201,6 +201,7 @@ EOF BRG_BNG_NIC=GigabitEthernet`echo ${NICS} | cut -d " " -f 2` # second interface in list echo $BRG_BNG_NIC > /opt/config/brg_nic.txt + cat > /etc/vpp/setup.gate << EOF set int state ${BRG_BNG_NIC} up set dhcp client intfc ${BRG_BNG_NIC} hostname brg-emulator @@ -212,9 +213,9 @@ set interface l2 bridge tap-0 10 0 set bridge-domain arp term 10 EOF - cat >> /opt/config/ip.txt << EOF -hcip: 192.168.4.20 -EOF +echo "sdnc_ip: $(cat /opt/config/sdnc_ip.txt)" > /opt/config/ip.txt +echo "hcip: 192.168.4.20" >> /opt/config/ip.txt + cat > /opt/bind_nic.sh << 'EOF' #!/bin/bash @@ -228,6 +229,7 @@ do fi done + BRG_BNG_NIC=$(cat /opt/config/brg_nic.txt) sdnc_ip=$(cat /opt/config/sdnc_ip.txt) @@ -242,7 +244,14 @@ vppctl ip route add 192.168.4.0/24 via tap-1 vppctl set interface snat in tap-1 out ${BRG_BNG_NIC} vppctl snat add interface address ${BRG_BNG_NIC} +#Get vBNG ip addr +output=$(vppctl show dhcp client) +vbng_ip=${output##*gw } +vppctl ip route add $vbng_ip/32 via $vbng_ip ${BRG_BNG_NIC} +vppctl ip route add $sdnc_ip/32 via $vbng_ip ${BRG_BNG_NIC} + +#Get HW addr of tap-1 while read -r hw do if [[ "$hw" = tap-1* ]]; @@ -253,6 +262,16 @@ do fi done < <(vppctl show hardware) arp -s $sdnc_ip $hw_addr +arp -s 20.0.0.40 $hw_addr + +#Get HW addr of tap0 +var=$(ifconfig tap0) +var=${var##*HWaddr} +var=${var%inet*} +tap0_addr=${var%inet*} + +vppctl set ip arp tap-1 192.168.4.20 $tap0_addr + EOF chmod +x /opt/bind_nic.sh |