quagga安装和使用

分类:  命令行编程


quagga安装和使用
测试环境-Fedora7.0
1.       下载源码
quagga-0.99.10.tar.gz
2.       解压缩
tar xzvf quagga-0.99.10.tar.gz
3.       配置
cd quagga-0.99.10
    ./configure --prefix =/usr
                --sysconfdir=/etc/quagga
                --localstatedir=/var/run/quagga
                --enable-vtysh
                --enable-user='test'
                --enable-group='test'
                 --enable-vty-group='test'
配置输出:
 

Quagga configuration

--------------------

quagga version          : 0.99.10

host operationg system  : linux-gnu

source code location    : .

compiler                : gcc

compiler flags          : -Os -fno-omit-frame-pointer -g -std=gnu99 -Wall -Wsign-compare -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wchar-subscripts -Wcast-qual

make                    : make
includes                : 

linker flags            :  -lcrypt   -lcap  -ltermcap -lreadline -lm

state file directory    : /var/run/quagga

config file directory   : /etc/quagga

example directory       : /etc/quagga

user to run as          : test

group to run as         : test

group for vty sockets   : test

config file mask        : 0600

log file mask           : 0600

 

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.

4.       编译和安装
make ;make install
5.       添加test组和用户
groupadd test;
    useradd test -g test
6.       改变权限 //最好写入启动脚本

chown test:test /var/run/quagga

chmod 777 /var/run/quagga   
chown test:test /etc/quagga //需要将配置写入操作系统
chmod 777 /etc/quagga/*                    
7.       增加log权限//最好写入启动脚本

Mkdir  /var/log/quagga/

Vi /var/log/quagga/zebra.log
Chmod 777 /var/log/quagga/zebra.log
 
8.       修改 /etc/services  //just for telnet

                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
 
 
9.       编辑配置文件

copy /etc/quagga/zebra.conf.example   /etc/quagga/zebra.conf

! -*- zebra -*-
!

! zebra sample configuration file

!
hostname Router
password zebra

enable password zebra

log file  /var/log/quagga/zebra.log//注意zebra.conf启用log,这样便于查找错误
 
 
10.     启动
zebra –d
如果启动不成功,察看/var/log/quagga/zebra.log
一般由于权限设置会出现以下错误:

2008/10/22 16:59:22 ZEBRA: Could not lock pid_file /var/run/quagga/zebra.pid, exiting

 
11.    登陆
telnet localhost zebra(0r 2601)
[root@localhost quagga-0.99.10]# telnet localhost 2601

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

 

Hello, this is Quagga (version 0.99.10).

Copyright 1996-2005 Kunihiro Ishiguro, et al.

 
 
User Access Verification
 
Password:
Router> enable
Password:
Router# help

Quagga VTY provides advanced help feature.  When you need help,

anytime at the command line please press '?'.

 

If nothing matches, the help list will be empty and you must backup

 until entering a '?' shows the available options.

Two styles of help are provided:

1. Full help is available when you are ready to enter a

command argument (e.g. 'show ?') and describes each possible

argument.

2. Partial help is provided when an abbreviated argument is entered

   and you want to know what arguments match the input

   (e.g. 'show me?'.)
 
Router#
 
12.    使用
 
 
 
 
 

Network Topology Overview


Configure R1
configure zebra.conf

! -*- zebra -*-
!
! zebra sample configuration file
!
! $Id: zebra.conf.sample,v 1.1.1.1 2002/12/13 20:15:30 paul Exp $
!
hostname Router
password zebra
enable password zebra

! list Interfaces
interface eth0
ip address 192.168.1.2/24

interface eth2
ip address 192.168.10.2/24

interface lo

!
! Static default route sample.
! null route to consolidate all subnets in this /24
!ip route 192.168.10.0/24 Null0 255
ip route 172.16.71.0/24 eth0

!log file
log file /var/log/quagga/zebra.log

line vty
 

configure ripd.conf

! -*- rip -*-
!
! RIPd sample configuration file
!
! $Id: ripd.conf.sample,v 1.1.1.1 2002/12/13 20:15:30 paul Exp $
!
hostname ripd
password zebra
enable password zebra

!
debug rip events
debug rip packet

!
router rip
network 192.168.1.0/24
network 192.168.10.0/24

!
!log file ripd.log
log file /var/log/quagga/ripd.log
 

Configure R2
configure zebra.conf

! -*- zebra -*-
!
! zebra sample configuration file
!
! $Id: zebra.conf.sample,v 1.1.1.1 2002/12/13 20:15:30 paul Exp $
!
hostname Router
password xxx
enable password xxx

! list Interfaces
interface eth0
ip address 172.16.71.121/24

interface eth2
ip address 192.168.1.5/24

interface lo
! Static default route sample
ip route 0.0.0.0/0 192.168.1.2

!log file zebra.log
log file /var/log/zebra/zebra.log

!
line vty
 

configure ripd.conf

! -*- rip -*-
!
! RIPd sample configuration file
!
! $Id: ripd.conf.sample,v 1.1.1.1 2002/12/13 20:15:30 paul Exp $
!
hostname ripd
password zebra
enable password zebra

!
debug rip events
debug rip packet

!
router rip
network 172.16.71.0/24
network 192.168.1.0/24
network 192.168.2.0/24
!
!log file ripd.log
log file /var/log/ripd.log

!
line vty

Hint :
 '!'  for comment
config file is put in 'PREFIX'/etc directory
if you want start ripd daemon, you must start zebra daemon at first
Testing Connectivity
start zebra/ripd daemon
login zebra vty

 $ telnet localhost zebra
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.

Hello, this is Quagga (version 0.98.5).
Copyright 1996-2005 Kunihiro Ishiguro, et al

User Access Verification

Password:
Router> show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

K>* 0.0.0.0/0 via 140.114.71.254, eth1
C>* 10.0.0.0/8 is directly connected, eth1
C>* 127.0.0.0/8 is directly connected, lo
C>* 140.114.71.0/24 is directly connected, eth1
R 172.16.71.0/24 [120/2] via 192.168.1.5, eth0, 1d04h26m
S>* 172.16.71.0/24 [1/0] is directly connected, eth0
C>* 192.168.1.0/24 is directly connected, eth0
R>* 192.168.2.0/24 [120/2] via 192.168.1.5, eth0, 1d04h26m
C>* 192.168.10.0/24 is directly connected, eth2
Router>

login ripd vty

[]$ telnet localhost ripd
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.

Hello, this is Quagga (version 0.98.5).
Copyright 1996-2005 Kunihiro Ishiguro, et al.


User Access Verification

Password:
ripd> show ip rip
Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP
Sub-codes:
(n) - normal, (s) - static, (d) - default, (r) - redistribute,
(i) - interface

Network Next Hop Metric From Tag Time
R(n) 172.16.71.0/24 192.168.1.5 2 192.168.1.5 0 02:40
C(i) 192.168.1.0/24 0.0.0.0 1 self 0
R(n) 192.168.2.0/24 192.168.1.5 2 192.168.1.5 0 02:40
C(i) 192.168.10.0/24 0.0.0.0 1 self 0
ripd>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Quagga软件原名是Zebra是由一个日本开发团队编写的一个以GNU版权方式发布的软件。Quagga项目开始与1996年,当前版本是0.98.4版 可以使用Quagga将linux机器打造成一台功能完备的路由器。 Quagga支持的路由协议 Quagga能够同时支持RIPv1、RIPv2、RIPng、OSPFv2、OSPFv3、BGP-4和 BGP-4+等诸多TCP/IP协议。其中: RIPv1、RIPv2、OSPFv2适用于Ipv4的自治域系统内部网络路由协议。 BGP-4是用于Ipv4的自治域系统之间的外部网络路由协议。 RIPng、OSPFv3、BGP-4+主要扩展对Ipv6的支持。 Quagga的特性 模块化设计:Quagga基于模块化方案的设计,即对每一个路由协议使用单独的守护进程。 运行速度快:因为使用了模块化的设计,使得Quagga的运行速度比一般的路由选择程序要快。 可靠性高:在所有软件模块都失败的情况下,路由器可以继续保持连接并且daemons也会继续运行。故障诊断不必离线的状态下被诊断和更正 支持Ipv6:Quagga不仅支持Ipv4,还支持Ipv6。 Quagga的运行机制 由于Quagga采用模块化的设计,因此Quagga运行时要运行多个守护进程,包括ripd ripngd ospfd ospf6d bgpd 和Zebra。 其中,Zebra守护进程用来更新内核的路由表,而其他的守护进程负责进行相应路由选择协议的路由更新。 Quagga的好处 就路由器而论,虽然有各种硬件可用,但是费用较高。所以想到用一个运行Linux系统构件的功能丰富的路由器作为代替。Quagga路由守护程序已经使这一切变为现实。因为Quagga支持Ipv4、Ipv6和其他各式各样的协议,所以能够满足通常所有的路由需要。
quagga是一款开源的路由软件套件,在Linux系统中广泛使用。要进行quagga源码安装,按照以下步骤操作: 1. 下载源码:在quagga的官方网站或者Github页面上找到最新的源码包,点击下载并保存到本地。 2. 解压源码:使用解压工具,如tar命令,将源码包解压到一个目录中,比如/home/user/quagga。 3. 安装所需依赖:使用shell命令进入解压后的quagga目录,执行以下命令安装所需的依赖库,以Ubuntu系统为例: ``` sudo apt-get update sudo apt-get install build-essential sudo apt-get install libreadline-dev sudo apt-get install texinfo sudo apt-get install pkg-config ``` 4. 配置和编译:在quagga目录中,执行以下命令进行配置: ``` ./configure ``` 然后执行以下命令进行编译: ``` make ``` 编译过程可能需要一些时间,请耐心等待。 5. 安装:编译成功后,执行以下命令进行安装: ``` sudo make install ``` 安装完成后,quagga将被安装到默认的系统目录中。 6. 配置和启动:安装完成后,可以通过编辑配置文件来配置quagga的路由设置,配置文件通常位于/etc/quagga目录下。然后,执行以下命令启动quagga服务: ``` sudo /etc/init.d/quagga start ``` 现在,quagga服务已启动并运行。 以上是quagga源码安装的简要步骤。根据不同的Linux发行版和系统环境,安装过程可能会有所差异,请根据具体情况进行操作,并参考quagga官方文档或社区支持获取更详细的安装指南。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值