1 下载:GitHub - Quagga/quagga: Quagga Tracking repository - Master is at http://git.savannah.gnu.org/cgit/quagga.git
2 安装
#安装依赖包
sudo apt install gcc make libreadline-dev pkg-config
#解压
tar zxvf quagga-1.2.4.tar.gz
cd quagga-1.2.4/
sudo ./configure
报错
checking for crypt in -lcrypt... yes
checking for res_init in -lresolv... no
checking whether system has GNU regex... checking for regexec in -lc... yes
checking for CARES... no
configure: error: Package requirements (libcares) were not met:
Package 'libcares', required by 'virtual:world', not found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables CARES_CFLAGS
and CARES_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
#下载安装:Releases · c-ares/c-ares (github.com)
tar zxvf c-ares-1.29.0.tar.gz
cd c-ares-1.29.0
./configure
make
sudo make install
#
sudo vim /etc/profile
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
source /etc/profile
#再次编译
cd quagga-1.2.4/
./configure --with-cflags=-fcommon
#
Quagga configuration
--------------------
quagga version : 1.2.4
host operating system : linux-gnu
source code location : .
compiler : gcc
compiler flags : -g -O2 -g -Os -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fpie -fno-omit-frame-pointer -Wall -Wextra -Wmissing-prototypes -Wmissing-declarati
ons -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializersmake : make
linker flags : -lcrypt -lrt -lreadline -ltermcap -lm
state file directory : /var/run
config file directory : /usr/local/etc
example directory : /usr/local/etc
user to run as : quagga
group to run as : quagga
group for vty sockets :
config file mask : 0600
log file mask : 0600
zebra protobuf enabled : no
The above user and group must have read/write access to the state file
directory and to the config files in the config file directory.
#
make
sudo make install
3 配置和启动
test@ubuntuserver:~$ sudo zebra -d
[sudo] password for test:
privs_init: could not lookup user quagga
#增加运行用户
sudo adduser quagga
sudo chown quagga:quagga /var/run/
sudo chown quagga:quagga /usr/local/etc/
#启动
sudo zebra -d
#查看
s -ef|grep quagga
quagga 1525 1 0 23:53 ? 00:00:00 zebra -d
test 1555 1378 0 23:58 pts/0 00:00:00 grep --color=auto quagga
#端口查看
sudo netstat -tnupl| grep zebra
tcp 0 0 0.0.0.0:2601 0.0.0.0:* LISTEN 1525/zebra
tcp6 0 0 :::2601 :::* LISTEN 1525/zebra
4 登录
sudo telnet 127.0.0.1 2601
5 启动动态路由器协议ospf
#报错
sudo ospfd -d
ospfd: error while loading shared libraries: libospf.so.0: cannot open shared object file: No such file or directory
#解决
sudo cp /usr/local/lib/libospf.so.0 /lib
#
sudo ospfd -d
#查看进程端口
sudo netstat -tnupl| grep ospfd
tcp 0 0 0.0.0.0:2604 0.0.0.0:* LISTEN 1705/ospfd
tcp6 0 0 :::2604 :::* LISTEN 1705/ospfd