1. 程式人生 > >58-高級路由:雙點雙向重分發

58-高級路由:雙點雙向重分發

mar redist color cto img 51cto nag 1.3 network

一、實驗拓撲:
技術分享圖片
二、實驗要求:
1、將R1的f1/0、R3的f0/0,f1/0、R4的f1/0,接口環回口修改為P-T-P模式;(加速OSPF速度,因為不需要選舉DR、BDR)
2、重分發規則:先順時針重分發,然後逆時針重分發(或者反過來)
①R1在OSPF進程裏重分發RIP;
②R4在RIP進程裏重分發OSPF;

③R1在RIP進程裏重分發OSPF;
④R4在OSPF進程裏重分發RIP;

3、①R1在OSPF進程裏重分發RIP:
問題:R4到24.1.1.0網段的路徑:R3——>R1——>R2,如何解決?
解決:R4在RIP進程下調小AD值,修改為:109;不帶ACL會使得12.1.1.0網段AD值也被修改,帶ACL可以單獨修改24.1.1.0網段;

4、②R4在RIP進程裏重分發OSPF:
Note:一般高優先級到低優先級不會有問題,但是低到高有是有問題的;

5、③R1在RIP進程裏重分發OSPF:

6、④R4在OSPF進程裏重分發RIP:
問題:R1到12.1.1.0網段的路徑:R3——>R1——>R4,如何解決?
解決:
方法1:R1在OSPF進程下調大AD值,修改為:121;不帶ACL會使得所有OSPF路由條目都變為121,帶ACL可以單獨修改網段;
方法2:R1在OSPF進程下部署distance ospf external 130 ,這個只是更改外部進來路由的AD值

三、命令部署:
1、將R1的f1/0接口、R3的f0/0,f1/0接口、R4的f1/0,接口環回口修改為P-T-P模式:

R1(config-if)#int f1/0
R1(config-if)#ip ospf network point-to-point

R3(config)#int f0/0
R3(config-if)#ip ospf network point-to-point
R3(config-if)#int f1/0
R3(config-if)#ip ospf network point-to-point

R4(config)#int f1/0
R4(config-if)#ip ospf network point-to-point
2、重分發:
①R1在OSPF進程裏重分發RIP:
R1(config)#router ospf 110

R1(config-router)#redistribute rip subnets

解決:R4在RIP進程部署命令修改AD值:
R4(config)#router rip
R4(config-router)#distance 109 24.1.1.2 255.255.255.255

②R4在RIP進程裏重分發OSPF:
R4(config)#router rip
R4(config-router)#redistribute ospf 110 metric 11

③R1在RIP進程裏重分發OSPF
R1(config)#router rip
R1(config-router)#redistribute ospf 110 metric 11

④R4在OSPF進程裏重分發RIP
R4(config)#router ospf 110
R4(config-router)#redistribute rip subnets
解決:R1在RIP進程部署命令修改AD值:
方法1:R1部署
R1(config)#router ospf 110
R1(config-router)#distance 121 4.4.4.4 255.255.255.255
方法2:R4部署
R1(config)#router ospf 110
R1(config-router)#no distance 121 0.0.0.0 255.255.255.255
R1(config-router)#distance ospf external 130

3、R2、R3有很多負載均衡,分別在R1、R4部署調整方法:
R1(config)#access-list 13 permit 13.1.1.0 0.0.0.255
R1(config-route-map)#route-map otr permit 10
R1(config-route-map)#match ip address 13
R1(config-route-map)#set metric 5
R1(config-route-map)#route-map otr permit 1000

R1(config)#access-list 34 permit 34.1.1.0 0.0.0.255
R1(config)#route-map otr permit 20
R1(config-route-map)#match ip address
R1(config-route-map)#set metric 12

R1(config)#access-list 40 permit 4.4.4.0 0.0.0.255
R1(config)#route-map otr permit 30
R1(config-route-map)#match ip address
R1(config-route-map)#set metric 12

R1(config)#router rip
R1(config-router)#redistribute ospf 110 route-map otr //重分發時調用

R4(config)#access-list 12 permit 12.1.1.0 0.0.0.255
R4(config)#access-list 10 permit 1.1.1.0 0.0.0.255
R4(config)#access-list 24 permit 24.1.1.0 0.0.0.255

R4(config)#route-map rto permit 12
R4(config-route-map)#match ip address 12
R4(config-route-map)#set metric 21

R4(config-route-map)#route rto permit 10
R4(config)#route-map rto permit 10
R4(config-route-map)#match ip address 10
R4(config-route-map)#set metric 21

R4(config-route-map)#route-map rto permit 24
R4(config-route-map)#match ip address 24
R4(config-route-map)#set metric 19
R4(config-route-map)#route-map rto permit 1000
R4(config)#router ospf 110
R4(config-router)#redistribute rip subnets route-map rto
四、驗證:
1、做完①問題:
R4#show ip route
O E2 2.2.2.0 [110/20] via 34.1.1.3, 00:00:13, FastEthernet1/0
3.0.0.0/32 is subnetted, 1 subnets
R4部署命令後:
R4#show ip route
R 1.1.1.0 [109/2] via 24.1.1.2, 00:00:18, FastEthernet0/0
R 2.2.2.0 [109/1] via 24.1.1.2, 00:00:18, FastEthernet0/0
R 12.1.1.0 [109/1] via 24.1.1.2, 00:00:21, FastEthernet0/0
13.0.0.0/24 is subnetted, 1 subnets

2、做完④問題:
R1#show ip route
O E2 2.2.2.0 [110/20] via 13.1.1.3, 00:01:04, FastEthernet1/0
O E2 24.1.1.0 [110/20] via 13.1.1.3, 00:01:05, FastEthernet1/0

R1部署方法1命令後:
R1#show ip route
34.0.0.0/24 is subnetted, 1 subnets
O 34.1.1.0 [121/2] via 13.1.1.3, 00:00:51, FastEthernet1/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
R 2.2.2.0 [120/1] via 12.1.1.2, 00:00:10, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [121/2] via 13.1.1.3, 00:00:51, FastEthernet1/0
4.0.0.0/24 is subnetted, 1 subnets
O 4.4.4.0 [121/3] via 13.1.1.3, 00:00:51, FastEthernet1/0
24.0.0.0/24 is subnetted, 1 subnets
R 24.1.1.0 [120/1] via 12.1.1.2, 00:00:11, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
R1部署方法2命令後:
R1#show ip route //正在選路
O E2 2.2.2.0 [130/20] via 13.1.1.3, 00:00:18, FastEthernet1/0
3.0.0.0/32 is subnetted, 1 subnets
O E2 24.1.1.0 [130/20] via 13.1.1.3, 00:00:20, FastEthernet1/0
12.0.0.0/24 is subnetted, 1 subnets

R1#show ip route //選路完畢
R 2.2.2.0 [120/1] via 12.1.1.2, 00:00:00, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 24.1.1.0 [120/1] via 12.1.1.2, 00:00:01, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
3、R1、R4未做部署前,R2、R3負載均衡路由:
R2#show ip route
R 34.1.1.0 [120/11] via 24.1.1.4, 00:00:09, FastEthernet1/0
[120/11] via 12.1.1.1, 00:00:22, FastEthernet0/0

R 4.4.4.0 [120/11] via 24.1.1.4, 00:00:11, FastEthernet1/0
[120/11] via 12.1.1.1, 00:00:24, FastEthernet0/0

R 13.1.1.0 [120/11] via 24.1.1.4, 00:00:12, FastEthernet1/0
[120/11] via 12.1.1.1, 00:00:25, FastEthernet0/0
R3#show ip route
O E2 1.1.1.0 [110/20] via 34.1.1.4, 00:28:06, FastEthernet1/0
[110/20] via 13.1.1.1, 00:28:06, FastEthernet0/0

O E2 24.1.1.0 [110/20] via 34.1.1.4, 00:07:43, FastEthernet1/0
[110/20] via 13.1.1.1, 00:07:43, FastEthernet0/0

O E2 12.1.1.0 [110/20] via 34.1.1.4, 00:28:22, FastEthernet1/0
[110/20] via 13.1.1.1, 00:28:22, FastEthernet0/0
R1、R4分別部署命令後:
R2#show ip route
R 34.1.1.0 [120/11] via 24.1.1.4, 00:00:04, FastEthernet1/0
R 4.4.4.0 [120/11] via 24.1.1.4, 00:00:04, FastEthernet1/0
R 13.1.1.0 [120/5] via 12.1.1.1, 00:00:14, FastEthernet0/0

R3#show ip route
O E2 1.1.1.0 [110/20] via 13.1.1.1, 00:02:00, FastEthernet0/0
O E2 24.1.1.0 [110/19] via 34.1.1.4, 00:02:01, FastEthernet1/0
O E2 12.1.1.0 [110/20] via 13.1.1.1, 00:02:03, FastEthernet0/0
技術分享圖片

58-高級路由:雙點雙向重分發