-
安装g++
apt-get install g++``apt-get install g++
. -
安装gawk:
apt-get install gawk
-
安装ncurses
apt-get install libncurses5-dev
-
安装libreadline
`第一种方法:apt-get install libreadline6 libreadline6-dev·
如果第一种方法在编译quagga-0.99.21时出现vtysh这个目录下不能make过的情况,请使用第二中方法安装readline。
第二种方法:- 下载readline-6.2.tar.gz
wget -c ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz - 解压readline-6.2.tar.gz
tar xzf readline-6.2.tar.gz - 编译安装
进入解压出来的目录中
./configure
make && make install
ldconfig
- 下载readline-6.2.tar.gz
`
安装quagga-0.99.21
解压压缩包:
tar xzf quagga-0.99.21_20131218.tar.gz
2. 编译安装
./configure --enable-vtysh --enable-zebra --enable-bgpd --enable-user=root --enable-group=root -enable-vty-group=root --enable-vty-group=root
(具体显示:
… /usr/local/lib/libreadline.so: undefined reference to PC' /usr/local/lib/libreadline.so: undefined reference to
tgetflag’
/usr/local/lib/libreadline.so: undefined reference to tgetent' /usr/local/lib/libreadline.so: undefined reference to
UP’
/usr/local/lib/libreadline.so: undefined reference to tputs' /usr/local/lib/libreadline.so: undefined reference to
tgoto’
/usr/local/lib/libreadline.so: undefined reference to tgetnum' /usr/local/lib/libreadline.so: undefined reference to
BC’
/usr/local/lib/libreadline.so: undefined reference to `tgetstr’
collect2: ld returned 1 exit status …
configure配置时,添加
LDFLAGS="-lncurses"就好了。)
make && make install
3. 加载库文件路径
ldconfig
4. 创建log目录
mkdir /var/log/quagga/
5. 编辑配置文件
cp /usr/local/etc/zebra.conf.sample /usr/local/etc/zebra.conf
进入/usr/local/etc/zebra.conf文件:
vim /usr/local/etc/zebra.conf进行修改
如果出现一下错误
zebra: error while loading shared libraries: libzebra.so.0: Cannot open shared object file: No such file or directory
解决方法:
在shell下使用find命令
find / -name libzebra.so.0
查找到此动态库的路径为/usr/local/lib/
在/etc/ld.so.conf中加入/usr/local/lib这一行,保存之后,再运行:/sbin/ldconfig –v更新一下配置即可
- vtysh 启动
zebra启动后 输入vtysh 启动vtysh
如果出现以下错误:
vtysh: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP
解决方法如下:
-
root@localhost:~ # cd /usr/local/lib
-
root@localhost:/usr/local/lib# ls -la libreadline*
-
root@localhost:/usr/local/lib# mkdir /tmp/libreadline_bk
-
root@localhost:/usr/local/lib# mv libreadline.* /tmp/libreadline_bk/.
-
root@localhost:/usr/local/lib# ldconfig
-
root@localhost:/usr/local/lib#apt-get update