#!/bin/bash # After Installation Script 0.2.0 for Openswitch OPX 3.0.0 frr_file='frr_5.0.1-1.debian9.1_amd64.deb' # Update packages apt-get update [ "$?" != 0 ] && echo "System can't be updated, exiting" && exit 1 # FRRouting is not in repository we need to install it locally wget https://github.com/FRRouting/frr/releases/download/frr-5.0.1/"$frr_file" apt-get -y install ./"$frr_file" if [ "$?" != 0 ]; then echo "FRrouting can't be installed, exiting" && exit 1 else rm "$frr_file" fi # Enable routing daemons, create empty config files, change owner & group to frr, set privilleges for daemon in zebra bgpd ospfd ospf6d ripd ripngd isisd eigrpd; do sed -i "s/$daemon=no/$daemon=yes/g" /etc/frr/daemons touch /etc/frr/"$daemon".conf chown frr:frr /etc/frr/"$daemon".conf chmod 640 /etc/frr/"$daemon".conf done # Add user opxUser to groups frr & frrvty sudo usermod -a -G frr opxUser sudo usermod -a -G frrvty opxUser # Restart the FRrouting service service frr restart if [ "$?" == 0 ]; then echo "FRRouting service restarted successfully" else echo "Can't restart FRRouting service" && exit 1 fi # Reduce timeout for network interfaces to 15sec 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 # Needed only for OPX 2.x.x, OPX 3.0.0 allows ARP therefore we don't need to flush ebtables # 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