路由优选这回事
R1 R2 R3 FR帧中继相连 s1/2 123.1.1.0/24 OSPF
R2 R3 R4 以太网相连 fa 0/0 23.1.1.0/24 EIGRP
R2R3上双点双向重发布
R1上其环回
R1(config)#int lo 1
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#int lo 2
R1(config-if)#ip add 192.168.2.1 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#int lo 3
R1(config-if)#ip add 192.168.3.1 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#int lo 4
R1(config-if)#ip add 192.168.0.1 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#end
这时R4将会收到这几天路由,且由R2R3负载均衡线路。
要求:
192.168.0.0和192.169.2.0走R2
192.168.1.0和192.168.4.0走R3
即要求 奇数网络号走R3,偶数网络号走R2,且不能破坏链路的冗余特性。
===>最佳解决办法,使用route-map修改相应路由条目的metric,使R4不优选从R2或R3发来的这条路由条目。
R2:
!
router eigrp 90
redistribute ospf 110 metric 10000 100 255 1 1500 route-map O2E
network 2.2.2.2 0.0.0.0
network 23.1.1.2 0.0.0.0
no auto-summary
!
router ospf 110
router-id 2.2.2.2
log-adjacency-changes
redistribute eigrp 90 subnets
network 2.2.2.2 0.0.0.0 area 0
network 123.1.1.2 0.0.0.0 area 0
!
access-list 13 permit 192.168.1.0
access-list 13 permit 192.168.3.0
route-map O2E permit 10
match ip address 13
set metric 10000 1000 255 1 1500
!
route-map O2E permit 20
!
R4上的路由表:
D EX 192.168.0.0/24 [170/284160] via 23.1.1.2, 00:00:19, FastEthernet0/0
123.0.0.0/24 is subnetted, 1 subnets
D EX 123.1.1.0 [170/284160] via 23.1.1.2, 00:00:06, FastEthernet0/0
[170/284160] via 23.1.1.3, 00:00:06, FastEthernet0/0
D EX 192.168.1.0/24 [170/284160] via 23.1.1.3, 00:00:07, FastEthernet0/0
D EX 192.168.2.0/24 [170/284160] via 23.1.1.2, 00:00:21, FastEthernet0/0
D EX 192.168.3.0/24 [170/284160] via 23.1.1.3, 00:00:07, FastEthernet0/0
同样这个实验可以大大地扩展,这只是冰山一角而已。好像还可以使用反掩码精确匹配奇数或者偶数路由网络条目。例如:使用
R2(config)#access-list 13 permit 192.168.1.0 0.0.254.255
来代替
access-list 13 permit 192.168.1.0
access-list 13 permit 192.168.3.0
+++++++++++++++++++++++++++++++++++++++++++++++++

没有评论:
发表评论