背景介绍:
1. 需求说明:
在大规模的路由网络中,例如在一个由省-地市-县-营业点组成的四级远程互连的路由网络中,如何维护大量的营业点路由器的直连子网路由和配置营业点的静态路由成为一个巨大的负担.此案例中说明了如何利用cisco On-Demand Routing (ODR)技术来优化这种大规模路由网络的一个设想.
2.ODR简介:
ODR技术(IOS 12.0.5T)能够使hub and spoke网络结构中的hub路由器自动地向spoke路由器(又称为stub站点)提供缺省路由,stub站点路由器不需要运行动态路由协议,也不需要配置任何的静态路由,几乎没有系统资源的占用,就能够实现本地所有的直连子网向hub路由器的自动通告.
3.ODR需求:
ODR使用Cisco Discovery Protocol (CDP)在hub路由器和spoke路由器之间传递路由信息,因此需要在hub和spoke路由之间的每条链路上启用cdp协议,cdp是一个data-link层协议,可以运行在Lan/serial/frame-relay/atm等传输介质上.
4.ODR配置任务:
(1)在hub路由器启用ODR
(2)在hub路由器把ODR再发布到某个动态路由协议中
(3)启用hub路由器接口的cdp
(4)启用spoke路由器接口的cdp
5.路由设计:
假定使用ospf协议来互连省级-地市级-县级网络,县级路由器同时作为ospf路由域的末节网络和ODR路由的hub路由器,将营业点规划为stub site(即spoke),通过合适的ospf区域规划和路由汇总,就能够使ospf互连更大规模的网络,假如一个省有10个地市,每个地市有10个县,每个县又有10个营业点,那么ospf只需管理大概100台路由器,而所有的营业点路由器(1000台)将通过ODR来自动管理路由信息而且几乎不占用系统资源(因为cdp是data-link层协议而且流量很少).
所有的营业网点路由器(1000台)不部署任何路由协议和静态路由,它们通过cdp自动向县级路由器发布自己的所有直连路由,而且县级路由器会自动通过odr向它们发送0.0.0.0/0.
6.结论
这个方案中, 如果进行合适的体系化ip编址,ospf区域规划和路由汇总, 整个ospf路由域所维护的路由数量将得到最大的优化.只有省级和地市级路由器需要维护少量的ospf网络的主干路由和到营业点的汇总路由,县级和营业点级路由器的负担都很小(普通25/26路由器即可).
论证:
一:实验拓扑:
1:基础配置:
FR的配置:
frame-relay switching
int s0/0
en fr ietf
frame-relay intf-type dce
clock rate 64000
frame-relay lmi-type ansi
frame-relay route 302 interface s0/1 203
no sh
int s0/1
en fr ietf
frame-relay intf-type dce
clock rate 64000
frame-relay lmi-type ansi
frame-relay route 203 interface s0/0 302
frame-relay route 201 interface s0/3 102
no sh
int s0/3
en fr ietf
frame-relay intf-type dce
clock rate 64000
frame-relay lmi-type ansi
frame-relay route 102 interface s0/1 201
no sh
|
R1(config)#int s0/3
R1(config-if)#encapsulation frame-relay
R1(config-if)#ip add 123.0.0.1 255.255.255.0
R1(config-if)#no frame-relay inverse-arp
R1(config-if)#no sh
R1(config-if)#int lo 0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#int s0/3
R1(config-if)#frame-relay map ip 123.0.0.1 102 b
R1(config-if)#frame-relay map ip 123.0.0.2 102 b
R1(config-if)#frame-relay map ip 123.0.0.3 102 b
R2(config)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#int s1/3
R2(config-if)#en frame-relay
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int s1/3
R2(config-if)#no frame-relay inverse-arp
R2(config-if)#exit
R2(config)#int s1/3.123 multipoint
R2(config-subif)#ip add 123.0.0.2 255.255.255.0
R2(config-subif)#no sh
R2(config-subif)#frame-relay map ip 123.0.0.1 201 b
R2(config-subif)#frame-relay map ip 123.0.0.2 201 b
R2(config-subif)#frame-relay map ip 123.0.0.3 203 b
R2(config-subif)#no sh
R3(config)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#int s0/3
R3(config-if)#encapsulation frame-relay
R3(config-if)#ip add 123.0.0.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#no frame-relay inverse-arp
R3(config-if)#frame-relay map ip 123.0.0.3 302 b
R3(config-if)#frame-relay map ip 123.0.0.2 302 b
R3(config-if)#frame-relay map ip 123.0.0.1 302 b
R3(config-if)#no sh
R2#sho cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater
Device ID Local Intrfce Holdtme Capability Platform Port ID
//查看邻居信息,发现没有邻居.
在FR环境下需要手动开启CDP.
R1(config)#cdp run
R1(config)#int s0/3
R1(config-if)#cdp enable
R2(config)#cdp run
R2(config)#int s1/3.123 multipoint
R2(config-subif)#cdp enable
R3(config)#cdp run
R3(config)#int s0/3
R3(config-if)#cdp enable
再次查看邻居,发现邻居已经起来了。
R2#sho cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater
Device ID Local Intrfce Holdtme Capability Platform Port ID
R3 Ser 1/3.123 175 R S I 3640 Ser 0/3
R1 Ser 1/3.123 134 R S I 3640 Ser 0/3
2:ODR和OSPF路由的配置:在R2上做ODR.
R2(config)#router odr
查看路由表
R1#sho ip route
Gateway of last resort is 123.0.0.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
123.0.0.0/24 is subnetted, 1 subnets
C 123.0.0.0 is directly connected, Serial0/3
o* 0.0.0.0/0 [160/1] via 123.0.0.2, 00:00:05, Serial0/3 ODR的管理距离是160。
R2#sho ip route
1.0.0.0/24 is subnetted, 1 subnets
o 1.1.1.0 [160/1] via 123.0.0.1, 00:00:55, Serial1/3.123
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
o 3.3.3.0 [160/1] via 123.0.0.3, 00:00:14, Serial1/3.123
123.0.0.0/24 is subnetted, 1 subnets
C 123.0.0.0 is directly connected, Serial1/3.123
R3#sho ip route
Gateway of last resort is 123.0.0.2 to network 0.0.0.0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
123.0.0.0/24 is subnetted, 1 subnets
C 123.0.0.0 is directly connected, Serial0/3
o* 0.0.0.0/0 [160/1] via 123.0.0.2, 00:00:06, Serial0/3
R2#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/56/84 ms
R2#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/85/108 ms
县级网络已经打通.
下来做通市县级网络。在R2和R4上启OSPF路由。
R2(config)#int f0/0
R2(config-if)#ip add 24.0.0.2 255.255.255.0
R2(config-if)#no sh
R4(config)#int f0/0
R4(config-if)#ip add 24.0.0.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#int lo 0
R4(config-if)#ip add 4.4.4.4 255.255.255.0
R2(config)#router os 1
R2(config-router)#network 123.0.0.0 0.0.0.255 a 0
R2(config-router)#net 24.0.0.0 0.0.0.255 a 0
R2(config-router)#net 2.2.2.0 0.0.0.255 a 0
R4(config)#router os 1
R4(config-router)#network 24.0.0.0 0.0.0.255 a 0
R4(config-router)#net 4.4.4.0 0.0.0.255 a 0
R2#sho ip route
1.0.0.0/24 is subnetted, 1 subnets
o 1.1.1.0 [160/1] via 123.0.0.1, 00:00:57, Serial1/3.123
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
o 3.3.3.0 [160/1] via 123.0.0.3, 00:00:16, Serial1/3.123
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 4.4.4.4/32 [110/2] via 24.0.0.4, 00:01:34, FastEthernet0/0
o 4.4.4.0/24 [160/1] via 24.0.0.4, 00:02:36, FastEthernet0/0
24.0.0.0/24 is subnetted, 1 subnets
C 24.0.0.0 is directly connected, FastEthernet0/0
123.0.0.0/24 is subnetted, 1 subnets
C 123.0.0.0 is directly connected, Serial1/3.123
R4#sho ip route
Gateway of last resort is 24.0.0.2 to network 0.0.0.0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 24.0.0.2, 00:02:15, FastEthernet0/0
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
24.0.0.0/24 is subnetted, 1 subnets
C 24.0.0.0 is directly connected, FastEthernet0/0
123.0.0.0/24 is subnetted, 1 subnets
O 123.0.0.0 [110/65] via 24.0.0.2, 00:02:15, FastEthernet0/0
//发现R4上没有到达R1,R3的路由。
在R2上将ODR路由重分配到OSPF.
R2(config)#router os 1
R2(config-router)#redistribute odr metric 200 subnets
//将重分配过来的ODR的路由管理距离改为200
再次查看R4的路由表
R4#sho ip route
1.0.0.0/24 is subnetted, 1 subnets
O E2 1.1.1.0 [110/200] via 24.0.0.2, 00:00:47, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 24.0.0.2, 00:00:47, FastEthernet0/0
3.0.0.0/24 is subnetted, 1 subnets
O E2 3.3.3.0 [110/200] via 24.0.0.2, 00:00:47, FastEthernet0/0
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
24.0.0.0/24 is subnetted, 1 subnets
C 24.0.0.0 is directly connected, FastEthernet0/0
123.0.0.0/24 is subnetted, 1 subnets
O 123.0.0.0 [110/65] via 24.0.0.2, 00:00:47, FastEthernet0/0
R1#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/64/192 ms
R3#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/68/132 ms
3:优化:
4#sho ip os int f0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 24.0.0.4/24, Area 0
Process ID 1, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 24.0.0.2
Backup Designated router (ID) 4.4.4.4, Interface address 24.0.0.4
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:08
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2 (Designated Router)
Suppress hello for 0 neighbor(s)
发现R2和R4之间是广播型网络,此处我们将它人为更改为点到点网络。
R2(config-router)#int f0/0
R2(config-if)#ip ospf network point-to-point
R4(config)#int f0/0
R4(config-if)#ip ospf network point-to-point
R4#sho ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 24.0.0.4/24, Area 0
Process ID 1, Router ID 4.4.4.4, Network Type POINT_TO_POINT, Cost: 1
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:05
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 2
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)
还需要在市县,市省网络之间做好汇总,此处实验环境省略^-^
//完全符合实际需要。
二:实验配置: