Last active
March 9, 2023 21:23
-
-
Save waja/0b532a04b7779aef66d630cf2e85abb5 to your computer and use it in GitHub Desktop.
migrate quagga over to frr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cp /usr/share/doc/quagga-core/examples/ospfd.conf.sample /etc/quagga/ospfd.conf && cp /usr/share/doc/quagga-core/examples/zebra.conf.sample /etc/quagga/zebra.conf && cp /usr/share/doc/quagga-core/examples/vtysh.conf.sample /etc/quagga/vtysh.conf | |
QUAGGA_USRGRP="frr:frr" | |
RELEASE="$(lsb_release -c -s)" | |
SERVICES=$(grep quagga /lib/systemd/system/*.service | cut -f1 -d: | uniq); | |
[ ! -f "/etc/apt/sources.list.d/${RELEASE}-backports-cyconet.list" ] && \ | |
printf "deb http://ftp.cyconet.org/debian ${RELEASE}-backports main non-free contrib\ndeb-src http://ftp.cyconet.org/debian ${RELEASE}-backports main non-free contrib\n" > /etc/apt/sources.list.d/${RELEASE}-backports-cyconet.list; \ | |
apt update && \ | |
apt-get install -t ${RELEASE}-backports -y frr; \ | |
[ -f /etc/frr/frr.conf ] && mv /etc/frr/frr.conf /etc/frr/frr.conf.orig; \ | |
for SERVICE in $SERVICES; do | |
DAEMON=$(basename -s .service $SERVICE); | |
cp -a /etc/quagga/$DAEMON.conf /etc/frr/; | |
sed -i "/^log file/d" /etc/quagga/$DAEMON.conf; | |
sed -i "/^hostname/a log file \/var\/log\/frr\/$DAEMON.log" /etc/frr/$DAEMON.conf; | |
chown ${QUAGGA_USRGRP} /etc/frr/$DAEMON.conf; | |
sed -i "s/^$DAEMON=no/$DAEMON=yes/" /etc/frr/daemons; | |
done ; \ | |
grep -E "^(hostname|password|log file|line)" /etc/frr/zebra.conf | sed s/zebra.log/staticd.log/g > /etc/frr/staticd.conf && \ | |
grep "^ip route" /etc/frr/zebra.conf >> /etc/frr/staticd.conf && \ | |
sed -i "/^ip route.*/d" /etc/frr/zebra.conf && \ | |
[ -f /etc/frr/ospfd.conf ] && sed -i "s/ translate-candidate no-summary//" /etc/frr/ospfd.conf; \ | |
chown ${QUAGGA_USRGRP} /etc/frr/staticd.conf && \ | |
systemctl restart frr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment