https://wiki.ubuntu.com/JonathanFerguson/Quagga
https://www.techonia.com/578/install-and-configure-quagga-in-ubuntu
Ubuntu 16.1
Quagga
sudo apt-get install quagga
echo "net.ipv4.conf.all.forwarding=1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv4.conf.default.forwarding=1" | sudo tee -a /etc/sysctl.conf
sed 's/#net.ipv6.conf.all.forwarding=1/net.ipv6.conf.all.forwarding=1/g' /etc/sysctl.conf | sudo tee /etc/sysctl.conf
echo "net.ipv6.conf.default.forwarding=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
sudo nano /etc/quagga/babeld.conf
sudo nano /etc/quagga/bgpd.conf
sudo nano /etc/quagga/isisd.conf
sudo nano /etc/quagga/ospf6d.conf
sudo nano /etc/quagga/ospfd.conf
sudo nano /etc/quagga/ripd.conf
sudo nano /etc/quagga/ripngd.conf
sudo nano /etc/quagga/vtysh.conf
sudo nano /etc/quagga/zebra.conf
sudo chown quagga:quagga /etc/quagga/babeld.conf && sudo chmod 640 /etc/quagga/babeld.conf
sudo chown quagga:quagga /etc/quagga/bgpd.conf && sudo chmod 640 /etc/quagga/bgpd.conf
sudo chown quagga:quagga /etc/quagga/isisd.conf && sudo chmod 640 /etc/quagga/isisd.conf
sudo chown quagga:quagga /etc/quagga/ospf6d.conf && sudo chmod 640 /etc/quagga/ospf6d.conf
sudo chown quagga:quagga /etc/quagga/ospfd.conf && sudo chmod 640 /etc/quagga/ospfd.conf
sudo chown quagga:quagga /etc/quagga/ripd.conf && sudo chmod 640 /etc/quagga/ripd.conf
sudo chown quagga:quagga /etc/quagga/ripngd.conf && sudo chmod 640 /etc/quagga/ripngd.conf
sudo chown quagga:quaggavty /etc/quagga/vtysh.conf && sudo chmod 660 /etc/quagga/vtysh.conf
sudo chown quagga:quagga /etc/quagga/zebra.conf && sudo chmod 640 /etc/quagga/zebra.conf
sudo nano /etc/quagga/daemons
要启动的路由协议后的 no 改成 yes
zebra=yes //zebra也要选yes
bgpd=yes
ospfd=yes
ospf6d=yes
ripd=yes
ripngd=yes
isisd=yes
babeld=yes
sudo nano /etc/quagga/debian.conf
vtysh_enable=yes
zebra_options=" --daemon -A 127.0.0.1 -P 2601 -u quagga -g quagga"
bgpd_options=" --daemon -A 127.0.0.1 -P 2605 -u quagga -g quagga --retain -p 179"
ospfd_options=" --daemon -A 127.0.0.1 -P 2604 -u quagga -g quagga"
ospf6d_options=" --daemon -A ::1 -P 2606 -u quagga -g quagga"
ripd_options=" --daemon -A 127.0.0.1 -P 2602 -u quagga -g quagga"
ripngd_options=" --daemon -A ::1 -P 2603 -u quagga -g quagga"
isisd_options=" --daemon -A 127.0.0.1 -P 2608 -u quagga -g quagga"
babeld_options=" --daemon -A 127.0.0.1 -P 2609 -u quagga -g quagga"
sudo /etc/init.d/quagga restart
使用Telnet链接localhost (zebra port) 输入密码登录,然后输入“enable”来获得所有特权。
$ telnet localhost zebra
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Hello, this is Quagga (version 0.99.22.1).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
User Access Verification
Password:
ubuntu> enable
ubuntu#
注意:如果使用Telnet进行配置,至少需要设置密码,否则会报错
如下所示:
$ telnet localhost zebra
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Vty password is not set.
Connection closed by foreign host.
因此需要先设置密码:
$ sudo echo "password typeyourpasswordhere" >> /etc/quagga/zebra.conf
现在可以通过zebra来设置一个IP地址了,重复以上步骤就可以完成BGP (bgpd.conf), OSPF (ospfd.conf) 等的配置。
Note that quagga is Cisco-like command so you should have familiarity with the Cisco command.
每次启动quagga都要输入
sudo /etc/init.d/quagga start
参考:
http://blog.csdn.net/hunanchenxingyu/article/details/43972495
http://www.cnblogs.com/end/archive/2012/10/12/2721059.html
注意:如果使用Telnet进行配置,至少需要设置密码,否则会报错
如下所示:
$ telnet localhost zebra Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Vty password is not set. Connection closed by foreign host.
因此需要先设置密码:
$ sudo echo "password typeyourpasswordhere" >> /etc/quagga/zebra.conf