乐趣区

quagga入门编译安装和启动

为了深入学习数据中心的架构,准备学习 EVPN,学习 BGP,入手 quagga。

下载 quagga 源码

admin@ubuntu:~$ wget http://mirror.ossplanet.net/nongnu/quagga/quagga-1.2.4.tar.gz

配置

./configure (默认的安装路径是 /usr/local/)

配置过程出现的问题:error: GNU awk is required for lib/memtype.h made by memtypes.awk.
BSD awk complains: awk: gensub doesn't support backreferences (subst"\1")

解决:sudo apt-get insatll gawk

配置过程出现的问题:configure: error: Package requirements (libcares) were not met:

No package 'libcares' 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.

解决方法:下载并安装 c -ares-1.12.0.tar.gz

admin@ubuntu:~$ wget https://c-ares.haxx.se/download/c-ares-1.14.0.tar.gz
admin@ubuntu:~$ ls
admin@ubuntu:~$ tar -xzvf c-ares-1.14.0.tar.gz 
admin@ubuntu:~$ l
admin@ubuntu:~$ cd c-ares-1.14.0/
admin@ubuntu:~$ ./configure 
admin@ubuntu:~$ make
admin@ubuntu:~$ sudo make install

启动

sudo zebra -d // 启动

出现错误:zebra: error while loading shared libraries: libzebra.so.1: cannot open shared object file: No such file or directory

解决办法:sudo cp /usr/local/lib/libzebra.so.1 /lib

然后重新执行 sudo zebra -d


开启 zebra 服务:zebra - d 就会出现 privs_init: could not lookup user quagga
  
增加用户组 quagga 和用户 quagga
  
admin@ubuntu:~$ sudo groupadd quagga           
admin@ubuntu:~$ sudo useradd quagga -g quagga              
admin@ubuntu:~$ sudo chown quagga:quagga /var/run/         
admin@ubuntu:~$ chown quagga:quagga /usr/local/etc/
admin@ubuntu:~$ sudo chown quagga:quagga /usr/local/etc/ 
admin@ubuntu:~$ chmod 777 /var/run/   
admin@ubuntu:~$ chmod 777 /usr/local/etc/

admin@ubuntu:~$ sudo cp /usr/local/etc/zebra.conf.sample   /usr/local/etc/zebra.conf
admin@ubuntu:~$ sudo zebra -d
admin@ubuntu:~$ sudo cp /usr/local/etc/bgpd.conf.sample   /usr/local/etc/bgpd.conf                  
admin@ubuntu:~$ sudo bgpd -d
admin@ubuntu:~$ sudo cp /usr/local/etc/vtysh.conf.sample   /usr/local/etc/vtysh.conf                 
admin@ubuntu:~$ sudo vtysh 
退出移动版