可以装linux的路由器,[转载]linux路由器Quagga的配置(一):安装
部分资料摘自http://blog.chinaunix.net/uid-25513153-id-212328.html
Quagga是一款功能比较强大的开源路由软件,支持rip,ripng,ospfv2,ospfv3,bgp等协议。目前最新版本为Quagga
0.99.17。安装Quagga的目的是使装有linux(我采用的是Ubuntu10.04LTS)系统的电脑变成一台路由器,以便今后的实验。之所以选择Quagga是因为它的操作和Cisco的操作是比较相似的。今天用到的电脑需要多块网卡支持(至少两块)。
安装Quagga
首先下载Quagga
0.99.17到硬盘,然后在终端输入
tar –zxvf quagga-0.99.17.tar.gz
进入目录
#cd quagga-0.99.17
配置
#./configure --enable-vtysh
--enable-user=root
--enable-group=root
--enable-vty-group=root
上述命令为打开vty功能(CLI功能)并给予相应用户权限,另有一些初始化配置见文档中.配置完成后会有一些信息表明quagga安装完成后相关文件所在位置。
此时出现错误:
checking for syslog.h... yes
checking for wchar.h... yes
checking for wctype.h... yes
checking for sys/sysctl.h... yes
checking for sys/sockio.h... no
checking for kvm.h... no
checking for sys/conf.h... no
checking for ucontext.h... yes
checking for special C compiler options needed for large files...
no
checking for _FILE_OFFSET_BITS value needed for large files...
64
checking for perl... /usr/bin/perl
checking for tputs in -ltermcap... yes
checking for main in -lreadline... no
configure: error: vtysh needs libreadline but was not found and
usable on your system.
zinkin@zinkin-desktop:~/quagga/quagga-0.99.17$
zinkin@zinkin-desktop:~/quagga/quagga-0.99.17$
--enable-user=root
--enable-user=root: command not found
zinkin@zinkin-desktop:~/quagga/quagga-0.99.17$
zinkin@zinkin-desktop:~/quagga/quagga-0.99.17$
--enable-group=root
--enable-group=root: command not found
zinkin@zinkin-desktop:~/quagga/quagga-0.99.17$
注:
①./configure是用来检测你的安装平台的目标特征的(比如它会检查是否有编辑器、函数库,CC或GCC等等),并根据配置信息生产相应的makefile,它是个shell脚本。
②./configure –h
输入此命令会一一列出当前配置环境所有配置选项
③此输入选项含义为,
启用相应服务程序,并对不用的服务程序进行关闭,其中--enable- user=root --enable-group=root
是限定quagg软件的使用权限。
④配置时易出现如下错误:
/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'
checking for perl...
/usr/bin/perl
checking for tputs in -ltermcap... no
checking for tputs in -ltinfo... no
checking for tputs in -lcurses... no
checking for tputs in -lncurses... no
checking for main in -lreadline... no
configure:
error: vtysh needs libreadline but was not found and usable on your
system
解决方法:
1 看readline软件包是否安装
sudo apt-get install
libreadline5-dev
2 是否安装ncurses安装包
sudo apt-get install
libncurses5-dev
3 是否安装libncurses5-dev
或libncursesw5-dev软件包
sudo apt-get install
libncursesw5-dev
安装完成之后再重新用配置命令
#./configure --enable-vtysh
#./configure --enable-user=root
#./configure --enable-group=root
#./configure --enable-vty-group=root
之后编译与安装
#make
#make install
之后出现错误
/usr/bin/install: cannot create regular file`/usr/local/lib/libprotobuf.so.0.0.0':
Permission denied
make[3]: *** [install-libLTLIBRARIES] Error 1
make[3]: Exit from catalogue
`/home/alexe/downloads/proto2/protobuf-2.0.0beta/src'
make[2]: *** [install-am] Error 2
make[2]: Exit from catalogue
`/home/alexe/downloads/proto2/protobuf-2.0.0beta/src'
make[1]: *** [install] Error 2
make[1]: Exit from catalogue
`/home/alexe/downloads/proto2/protobuf-2.0.0beta/src'
make: *** [install-recursive] Error 1
可以采用
#sudo make
#sudo make install
3.修改文件/etc/services,添加如下内容(某些版本Ubuntu已有,就不用添加了)
zebrasrv 2600/tcp # zebra service
zebra 2601/tcp # zebra vty
ripd 2602/tcp # RIPd vty
ripngd 2603/tcp # RIPngd vty
ospfd 2604/tcp # OSPFd vty
bgpd 2605/tcp # BGPd vty
ospf6d 2606/tcp # OSPF6d vty
ospfapi 2607/tcp # ospfapi
isid 2608/tcp # ISISd vty
之后查看/etc/services,这个文件,发现已经里面有上面这段东西了。
quagga文件夹下/zebra有一个zebra.conf.sample文件,需建立一个zebra.conf文件并把zebra.conf.sample内容copy进去.
启动Quagga
在终端输入zebra -d即可启动quagga。有可能出现以下错误:
zebra: error while loading shared libraries:
libzebra.so.0: cannot open shared object file: No such file or
directory
解决方法:
在/usr/local/lib下有
lrwxrwxrwx 1 root root 17 2010-06-21 01:52
libzebra.so -> libzebra.so.0.0.0
lrwxrwxrwx 1 root root 17 2010-06-21 01:52
libzebra.so.0 -> libzebra.so.0.0.0
-rwxr-xr-x 1 root root 778556 2010-06-21 01:52
libzebra.so.0.0.0
这可能是由于/lib库出现问题:则
zinkin@zinkin-desktop:~/quagga/quagga-0.99.17$ cd
/usr/local/lib
zinkin@zinkin-desktop:/usr/local/lib$ cp libzebra.* /lib
zinkin@zinkin-desktop:/usr/local/lib$ sudo rm libzebra.*
在终端输入zebra -d即可启动quagga。
zinkin@zinkin-desktop:~/quagga/quagga-0.99.17$ zebra -d
privs_init: could not lookup user quagga
[root@localhost1 quagga-0.99.15]#
zebra
privs_init: could not lookup user quagga
[root@localhost1 quagga-0.99.15]# zebra
--help
Usage : zebra [OPTION...]
Daemon which manages kernel routing table management and
redistribution between different routing protocols.
-b,
--batch Runs in batch mode
-d,
--daemon Runs in daemon mode
-f, --config_file Set configuration file
name
-i,
--pid_file Set process identifier file name
-k, --keep_kernel Don't delete old routes which
installed by zebra.
-C,
--dryrun Check configuration for validity and exit
-A,
--vty_addr Set vty's bind address
-P,
--vty_port Set vty's port number
-r,
--retain When program terminates, retain added route by zebra.
-u, --user User to run
as
-g,
--group Group to run as
-s, --nl-bufsize Set netlink
receive buffer size
-v,
--version Print program version
-h,
--help Display this help and exit
Report bugs to http://bugzilla.quagga.net
[root@localhost1 quagga-0.99.15]# zebra
-d -u root -g root
vty_read_config: failed to open configuration file
/usr/local/etc/zebra.conf: No such file or directory
can't open configuration file [/usr/local/etc/zebra.conf]
[root@localhost1 quagga-0.99.15]# cp -Rf
/usr/local/etc/zebra.conf.sample /usr/local/etc/zebra.conf
[root@localhost1 quagga-0.99.15]# zebra
-d -u root -g root
[root@localhost1 quagga-0.99.15]# telnet
localhost 2601
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Hello, this is Quagga (version
0.99.15).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
由于自己的程序没有在root下,所以有些语句前面得用sudo
zinkin@zinkin-desktop:~/quagga/quagga-0.99.17$ sudo zebra -d -u
root -g root
zinkin@zinkin-desktop:~/quagga/quagga-0.99.17$ telnet localhost
2601
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Hello, this is Quagga (version 0.99.17).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
User Access Verification
Password:
这样就说明已经将quaga安装成功了!
下一篇讲如何配置。
可以装linux的路由器,[转载]linux路由器Quagga的配置(一):安装相关推荐
- linux内核体系学习路径_Linux内核分析(一)linux体系简介|内核源码简介|内核配置编译安装...
从本篇博文开始我将对linux内核进行学习和分析,整个过程必将十分艰辛,但我会坚持到底,同时在博文中如果那些地方有问题还请各位大神为我讲解. 今天我们会分析到以下内容: 1. Linux体系结构简介 ...
- lammps linux运行命令,[转载]linux下 lammps的安装以及计算初步使用
好久没有用linux了,都忘记的差不多了,计算材料课设需要用此平台计算,又开始学习一下 第一步:安装g++编译器 sudo apt-get install build-essential 第二步:将l ...
- linux常见故障处理,[转载]Linux常见操作和故障处理汇总
1.SSH登录提示:** !! ILLEGAL HOST KEY FOR 172.16.25.3 !! ** Remove /root/.ssh2/hostkeys/key_36000_172.16. ...
- linux+systemc+编译,[转载]linux下systemC的安装编译仿真
一.systemc的安装 花了将近一天的时间终于成功安装systemC,下面记录下整个过程. (1)在www.systemc.org网站下载systemc-2.2.0.tgz. (2)将其copy到l ...
- linux 增量备份文件,[转载]linux 文件增量备份 用tar实现
#!/bin/bash #好的做法 #根据项目不同来重命名该脚本 #例如 amountebak.sh or pandawillsbak.sh #该脚本最好放在 $bakpp定义的绝对路径部分 #你可以 ...
- linux shell gsub,[转载]Linux Shell常用技巧(五)-第二部分
6. 数组:因为awk中数组的下标可以是数字和字母,数组的下标通常被称为关键字(key).值和关键字都存储在内部的一张针对key/value应用hash的表格里.由于hash不是顺序存储,因此在显示数 ...
- linux ls –il,[转载]linux中ls -l 介绍
[root@localhost ~]# ls -l 总计 152 -rw-r--r-- 1 root root 2915 08-03 06:16 a -rw------- 1 root root 10 ...
- 巧用Linux 架设TFTP Server备份路由器的配置文件
本文首发<网管员世界> 转载本文站点: ChinaITLAB TFTP (普通文件传输协议或一般文件传输协议) 大家一定记得在2003年8月12日全球爆发冲击波(Worm.Blaster ...
- 利用Linux或者Windows操作系统做路由器进行网络互连
利用Linux或者Windows操作系统做路由器进行网络互连 实验地点:4楼2机房 实验环境:PC27(装有Linux操作系统) ,PC12(装用windows server 2003 和Linux操 ...
最新文章
- Android知识点复习2(Service)
- 【Android源码剖析】(API 19)[View-----MeasureSpec]
- 网络推广费用之你的文章标题优化“合格”了吗?
- HDOJ 2049 不容易系列之(4)——考新郎
- LeetCode 1288. 删除被覆盖区间(lambda排序)
- VUE搭建开发,以及打包。
- 基本矩阵的基本解法之8点算法
- Zend Framework实例教程三
- 代码意识流——花朵数问题(一)
- JAVA:二进制和十进制互转
- matlab演化博弈仿真
- python结巴怎么安装_Python3.6 结巴分词安装和使用
- 服务器硬盘一般怎样备份,GHOST对硬盘系统分区(一般是C盘)的备份和恢复图文教程,对操作系统的备份和恢复...
- mysql添加多字段唯一索引吗_mysql多字段唯一索引
- VirtualBox简单使用
- 一个毕业生的年终总结
- 让传感器数据在三维地图上显示,更直观,更震撼!
- 电脑的wifi天线原理_详解无线路由器天线的原理
- 我的价值观:底线和极限以及价值观空间
- a与文件下载-(下载一)
热门文章
- ASP.NET MVC 中删除无用视图引擎
- 用MATLAB实现神经网络
- 拼团功能实现 php_PHP实现微信提现功能
- python调用系统命令_linux里面python调用系统命令问题
- 南京理工大学计算机学院教师信息网,南京理工大学教师信息
- 中国上海量子计算机,首台光量子计算机在上海亮相
- python 全局变量使用报错没有定义_Python变量作用域代码解析
- 学计算机广东2B大学,2021年广东省较好的2B大学排名,广东2B大学排名出炉
- 桔子浏览器电脑版如何登录 桔子浏览器PC版账号登录教程
- IE浏览器高级设置如何还原