Fix ARP issues in vLB and vPKTGEN
[demo.git] / vnfs / vLB / scripts / v_dns_install.sh
index 83441ac..84d7a01 100644 (file)
@@ -42,9 +42,6 @@ then
        echo "    address $IP" >> /etc/network/interfaces
        echo "    netmask $NETMASK" >> /etc/network/interfaces
        echo "    mtu $MTU" >> /etc/network/interfaces
-
-       ifup eth1
-       ifup eth2
 fi
 
 # Download required dependencies
@@ -54,7 +51,6 @@ apt-get install -y wget openjdk-8-jdk bind9 bind9utils bind9-doc apt-transport-h
 sleep 1
 
 # Download vDNS demo code for DNS Server
-mkdir /opt/config
 mkdir /opt/FDclient
 cd /opt
 
@@ -92,4 +88,17 @@ sleep 1
 cd /opt
 mv vdns.sh /etc/init.d
 update-rc.d vdns.sh defaults
+
+# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
+if [[ $CLOUD_ENV != "rackspace" ]]
+then
+       sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
+       grub-mkconfig -o /boot/grub/grub.cfg
+       sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
+       sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
+       echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
+       echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
+       reboot
+fi
+
 ./v_dns_init.sh
\ No newline at end of file