via 192.168.100.1, eth1
N 3.3.3.0/24 [20] area: 0.0.0.0
via 192.168.102.1, eth2
N 4.4.4.0/24 [10] area: 0.0.0.0
directly attached to dummy0
N 192.168.100.0/30 [10] area: 0.0.0.0
directly attached to eth1
N 192.168.101.0/30 [20] area: 0.0.0.0
via 192.168.100.1, eth1
via 192.168.102.1, eth2
N 192.168.102.0/30 [10] area: 0.0.0.0
directly attached to eth2
============ OSPF router routing table =============
============ OSPF external routing table ===========
路由表:
[root@3GFirewallSettings root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.0 0.0.0.0 255.255.255.252 U 0 0 0 eth1
192.168.101.0 192.168.100.1 255.255.255.252 UG 20 0 0 eth1
192.168.102.0 0.0.0.0 255.255.255.252 U 0 0 0 eth2
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
2.2.2.0 192.168.100.1 255.255.255.0 UG 20 0 0 eth1
3.3.3.0 192.168.102.1 255.255.255.0 UG 20 0 0 eth2
4.4.4.0 0.0.0.0 255.255.255.0 U 0 0 0 dummy0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.0.1.169 0.0.0.0 UG 0 0 0 eth0
-------------------------------------------
验证协议:
在断开R3 ---->R1之前,在R3上如下:
[root@3GFirewallSettings root]# traceroute 3.3.3.3
traceroute to 3.3.3.3 (3.3.3.3), 30 hops max, 38 byte packets
1 3.3.3.3 (3.3.3.3) 0.216 ms 0.154 ms 0.114 ms
说明R3到3.3.3.0/24是通过R1直接到达
断开R3---->R1之间线路,过1mins左右(OSPF收敛时间大概是30s)
[root@3GFirewallSettings root]# traceroute 3.3.3.3
traceroute to 3.3.3.3 (3.3.3.3), 30 hops max, 38 byte packets
1 192.168.100.1 (192.168.100.1) 0.204 ms 0.167 ms 0.116 ms
2 3.3.3.3 (3.3.3.3) 0.459 ms 0.248 ms 0.204 ms
说明R3到达3.3.3.0/24网络是通过R2之后,通过R1到达。
当前R3路由表如下:
[root@3GFirewallSettings root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.0 0.0.0.0 255.255.255.252 U 0 0 0 eth1
192.168.101.0 192.168.100.1 255.255.255.252 UG 20 0 0 eth1
192.168.102.0 0.0.0.0 255.255.255.252 U 0 0 0 eth2
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
2.2.2.0 192.168.100.1 255.255.255.0 UG 20 0 0 eth1
3.3.3.0 192.168.100.1 255.255.255.0 UG 30 0 0 eth1
4.4.4.0 0.0.0.0 255.255.255.0 U 0 0 0 dummy0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.0.1.169 0.0.0.0 UG 0 0 0 eth0
结论:
Zebra可以在Linux环境下可以实现动态路由协议。
RIP收敛时间大概是3mins。(30s一次广播)
OSPF收敛时间大概是30s。
由于本文只是验证RIP、OSPF协议,所以对Zebra的使用没有详细介绍。