使用zebra配置動態路由(版本0.93b)

使用zebra配置動態路由(版本0.93b<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

開機自動運行zebra

# chkconfig –add zebra on

啓動zebra

# service zebra start

 

Zebra的配置文件

Vtysh.conf 是配置zebra使用的shell配置文件;zebra.confzebra的主配置文件;

 

Zebra對每種路由選擇協議有單獨的配置文件

RIP所需的ripd.conf

OSPF所需的ospf.conf

BGP所需的bgp.conf

 

使用zebra配置支持RIP路由協議的路由器

1、          啓動路由選擇守護進程ripd

# touch /etc/zebra/ripd.comf

# service ripd start

注:# chkconfig –add ripd on

2、          配置支持RIP路由協議的路由器

子網A網段爲192.168.1.0/24

子網B的網段爲192.168.10.0/24

Linux主機eth0 192.168.1.1 ; eth1 192.168.10.1

3、          //linux 主機上使用vtysh 配置zebra

 [root@winner zebra]# vtysh

 

Hello, this is zebra (version 0.93b).

Copyright 1996-2002 Kunihiro Ishiguro.

 

winner> enable

winner#

winner# configure terminal

winner(config)# interface eth0

winner(config-if)# ip address 192.168.1.1/24

winner(config-if)# exit

winner(config)# interface eth1

winner(config-if)# ip address 192.168.10.1/24

winner(config-if)# exit

winner(config)# router rip

winner(config-router)# network 192.168.1.0/24

winner(config-router)# network 192.168.10.0/24

winner(config-router)# end

winner#show interface

Interface lo

  index 1 metric 1 mtu 16436 <UP,LOOPBACK,RUNNING>

  inet 127.0.0.1/8

    input packets 178, bytes 17859, dropped 0, multicast packets 0

    input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

    output packets 178, bytes 17859, dropped 0

    output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

    collisions 0

Interface eth0

  index 2 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,MULTICAST>

  HWaddr: 00:<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />0c:29:32:44:ab

  inet 192.168.1.1/24 broadcast 192.168.0.255

    input packets 47622, bytes 4022418, dropped 0, multicast packets 0

    input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

    output packets 3301, bytes 479332, dropped 0

    output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

    collisions 0

Interface eth1

index 3 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,MULTICAST>

  HWaddr: 00:0c:29:32:44:ab

  inet 192.168.10.1/24 broadcast 192.168.0.255

    input packets 47622, bytes 4022418, dropped 0, multicast packets 0

    input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

    output packets 3301, bytes 479332, dropped 0

    output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

    collisions 0

winner# show ip rip

Codes: R - RIP, C - connected, O - OSPF, B - BGP

      (n) - normal, (s) - static, (d) - default, (r) - redistribute,

      (i) - interface

 

     Network            Next Hop         Metric From            Time

C(i) 192.168.1.0/24            0.0.0.0                1 self

C(i) 192.168.10.0/24            0.0.0.0                1 self

winner# copy running-config startup-config

winner# quit

 

4、          測試支持riplinux路由器

(附註)客戶機添加路由

Windows : route add 192.168.10.0 mask 255.255.255.0 192.168.1.1

Linux: route add –net 192.168.10.0 netmask 255.255.255.0 gw 192.168.1.1

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章