summaryrefslogtreecommitdiffstats
path: root/nfvbenchvm/dib/elements
diff options
context:
space:
mode:
authorfmenguy <francoisregis.menguy@orange.com>2020-01-22 16:00:48 +0100
committerfmenguy <francoisregis.menguy@orange.com>2020-01-23 15:40:20 +0100
commitae838f98fa020d0ad0aa37ab58e02456889c3375 (patch)
treefff47c59632bf76053df08c860ded46fccafd1a2 /nfvbenchvm/dib/elements
parent95f2491ed89ac99b0d8bd006b4a13cbeb1eb96ce (diff)
NFVBENCH-157 Add possibility to not use the ARP static configuration for VPP loop VM
Change-Id: Ifd3f183345e21c7866e9e9898c7bbda601793b2c Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
Diffstat (limited to 'nfvbenchvm/dib/elements')
-rw-r--r--nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local14
1 files changed, 12 insertions, 2 deletions
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local
index 64557d4..d69cd0e 100644
--- a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local
@@ -211,12 +211,22 @@ if [ $PCI_ADDRESS_1 ] && [ $PCI_ADDRESS_2 ]; then
INTFS=`vppctl show int | grep Ethernet | xargs`
INTF_1=`echo $INTFS | awk '{ print $1 }'`
INTF_2=`echo $INTFS | awk '{ print $4 }'`
+ if [ -z "${TG_MAC1}" ]; then
+ # vm.conf does not support lines commented with #, so
+ # we need to remove the line to set the static ARP entry.
+ sed -i "/{{TG_MAC1}}/d" /etc/vpp/vm.conf
+ else
+ sed -i "s/{{TG_MAC1}}/${TG_MAC1}/g" /etc/vpp/vm.conf
+ fi
+ if [ -z "${TG_MAC2}" ]; then
+ sed -i "/{{TG_MAC2}}/d" /etc/vpp/vm.conf
+ else
+ sed -i "s/{{TG_MAC2}}/${TG_MAC2}/g" /etc/vpp/vm.conf
+ fi
sed -i "s/{{INTF_1}}/${INTF_1//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{INTF_2}}/${INTF_2//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{VNF_GATEWAY1_CIDR}}/${VNF_GATEWAY1_CIDR//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{VNF_GATEWAY2_CIDR}}/${VNF_GATEWAY2_CIDR//\//\/}/g" /etc/vpp/vm.conf
- sed -i "s/{{TG_MAC1}}/${TG_MAC1}/g" /etc/vpp/vm.conf
- sed -i "s/{{TG_MAC2}}/${TG_MAC2}/g" /etc/vpp/vm.conf
sed -i "s/{{TG_NET1}}/${TG_NET1//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{TG_NET2}}/${TG_NET2//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{TG_GATEWAY1_IP}}/${TG_GATEWAY1_IP}/g" /etc/vpp/vm.conf