Ubuntu server 24 源码安装Quagga 支持动态路由协议ospf bgp

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  

  • 13
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值