You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
1.8 KiB
88 lines
1.8 KiB
#!/usr/bin/bash
|
|
|
|
configQuagga() {
|
|
|
|
echo "Configure Zebra."
|
|
extra=""
|
|
case $1 in
|
|
r1) INTERFACES="eth1 eth2"; NETS="1 2 3"; ID=1 ;;
|
|
r2) INTERFACES="eth0 eth1 eth2"; NETS="2 4 5"; ID=2;;
|
|
r3) INTERFACES="eth1 eth2"; NETS="4 6 7"; ID=3; extra='default-information originate';;
|
|
r4) INTERFACES="eth0 eth1"; NETS="3 8"; ID=4;;
|
|
r5) INTERFACES="eth0 eth1 eth2"; NETS="5 7 8"; ID=5;;
|
|
esac
|
|
vdn-ssh root@$1 "
|
|
[ ! -e /etc/quaga/vtysh.conf ] && cp /usr/share/doc/quagga-core/examples/vtysh.conf.sample /etc/quagga/vtysh.conf
|
|
|
|
|
|
cat << EOF > /etc/quagga/zebra.conf
|
|
!/etc/quagga/zebra.conf
|
|
hostname router1
|
|
password bigsecret
|
|
enable password iut
|
|
service advanced-vty
|
|
log file /var/log/quagga/zebra.log
|
|
!
|
|
!administrative access controls- local machine only
|
|
!
|
|
access-list localhost permit 127.0.0.1/32
|
|
access-list localhost deny any
|
|
!
|
|
line vty
|
|
access-class localhost
|
|
EOF
|
|
|
|
cat << EOF > /etc/quagga/ripd.conf
|
|
!/etc/quagga/ripd.conf
|
|
hostname router1
|
|
password moresecret
|
|
enable password moresecret
|
|
router rip
|
|
network eth0
|
|
network eth1
|
|
network eth2
|
|
! valeurs par défaut des timers : 30 180 120
|
|
timers basic 10 30 20
|
|
redistribute static
|
|
redistribute connected
|
|
service advanced-vty
|
|
log file /var/log/quagga/ripd.log
|
|
!
|
|
!administrative access controls- local machine only
|
|
!
|
|
access-list localhost permit 127.0.0.1/32
|
|
access-list localhost deny any
|
|
!
|
|
line vty
|
|
access-class localhost
|
|
$extra
|
|
EOF
|
|
|
|
#cp /usr/share/doc/quagga/examples/vtysh.conf.sample /etc/quagga/vtysh.conf
|
|
chown quagga:quagga /etc/quagga/zebra.conf /etc/quagga/ripd.conf
|
|
chown :quaggavty /etc/quagga/vtysh.conf
|
|
|
|
systemctl enable zebra
|
|
systemctl restart zebra
|
|
systemctl enable ripd
|
|
systemctl restart ripd
|
|
"
|
|
}
|
|
|
|
configBase() {
|
|
|
|
setErrorHandler
|
|
echoStart
|
|
|
|
#setIpv6WorkAround $1
|
|
setHostname $1
|
|
|
|
}
|
|
|
|
endConfig() {
|
|
unsetErrorHandler
|
|
echoDone
|
|
}
|
|
|
|
|