#!/bin/bash # After Openswitch OPX Installation Script 0.1.0 #Quagga Routing Suite Installation apt-get install -y quagga [ "$?" != 0 ] && echo "Quagga can't be installed, exiting" && exit 1 #Enable Routing Daemons for daemon in zebra bgpd ospfd ospf6d ripd ripngd isisd; do sed -i "s/$daemon=no/$daemon=yes/g" /etc/quagga/daemons; done #Create configuration files vtysh.conf and Quagga.conf cp /usr/share/doc/quagga/examples/vtysh.conf.sample /etc/quagga/vtysh.conf touch /etc/quagga/Quagga.conf #Enable paging in the /etc/environment file. echo VTYSH_PAGER=more > /etc/environment #Restart the Quagga service service quagga restart if [ "$?" == 0 ]; then echo "Quagga service restarted successfully" else echo "Can't restart Quagga service" && exit 1 fi #Short timeout for network interfaces to 15s during boot mkdir -p /etc/systemd/system/networking.service.d echo "[Service]" > /etc/systemd/system/networking.service.d/reduce-timeout.conf echo "TimeoutStartSec=15" >> /etc/systemd/system/networking.service.d/reduce-timeout.conf #Flush ebtables and make the change persistent ebtables -t filter -F echo "ebtables -t filter -F" >> /usr/bin/dn_rules.sh #Wait for bringing up interface e101-032-0 during boot echo '#!/bin/bash' > /etc/rc.local echo "while [ \"\$int\" != 'e101-032-0' ]; do" >> /etc/rc.local echo " int=\"\$(/sbin/ifconfig -a | /bin/grep 'e101-032-0' | cut -d \" \" -f1)\"" >> /etc/rc.local echo " sleep 2" >> /etc/rc.local echo "done" >> /etc/rc.local echo >> /etc/rc.local echo "exit 0" >> /etc/rc.local exit 0