使用zebra配置动态路由(版本0.93b)
开机自动运行zebra # chkconfig –add zebra on 启动zebra # service zebra start |
Zebra的配置文件 Vtysh.conf 是配置zebra使用的shell配置文件;zebra.conf是zebra的主配置文件; |
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: 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、 测试支持rip的linux路由器 |
(附注)客户机添加路由 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 |