1. 程式人生 > >ospf與rip雙點雙向重分發實驗-實現負載均衡

ospf與rip雙點雙向重分發實驗-實現負載均衡

cati 負載 均衡 變化 nec candidate 希望 mas term

本次實驗,路由器,思科的網絡設備
拓撲如下(比較簡單):
技術分享圖片
首先是動態路由協議配置及ip配置
-----------1
en
conf t
router ospf 1
router-id 1.1.1.1
netw 192.168.12.1 0.0.0.0 area 0
exit
router rip
ver 2
no aut
netwo 192.168.14.0
exit
--------------2
en
conf t
int l0
ip add 2.2.2.2 255.255.255.0
ip ospf net point-to-po
router ospf 1
router-id 2.2.2.2
network 192.168.12.2 0.0.0.0 area 0
netwo 192.168.23.2 0.0.0.0 area 0
netw 2.2.2.0 0.0.0.255 area 0
exit
---------------3
en
conf t
router ospf 1
router-id 3.3.3.3
netw 192.168.23.3 0.0.0.0 area 0
exit
router rip
ver 2
no aut
netwo 192.168.34.0
exit
--------4
en
conf t
router rip
ver 2
no aut
netw 192.168.34.0
netwo 192.168.14.0
netwo 4.4.4.0
exit
ip 地址配置:2.2.2.2是R2 4.4.4.4是R4
主要查看3和1路由器中路由表的變化

接下來是重發布,首先將AD值小的ospf重發布到AD值大的RIP中去
====================================ospf-rip

-------------------1
en
conf t
router rip
redistribute ospf 1 metric 2
end
wr
------------------3
en
conf t
router rip
red ospf 1 met 2
end
wr

====================================
其次將rip重發布到ospf中去
=====================================rip-ospf

---------------------1
en
conf t
router ospf 1
red rip subn
end
wr

---------------------3
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

  2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/65] via 192.168.23.2, 00:19:37, Serial1/1
4.0.0.0/24 is subnetted, 1 subnets
O E2 4.4.4.0 [110/20] via 192.168.23.2, 00:06:34, Serial1/1
O 192.168.12.0/24 [110/128] via 192.168.23.2, 00:19:37, Serial1/1
O E2 192.168.14.0/24 [110/20] via 192.168.23.2, 00:06:34, Serial1/1
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, Serial1/1
L 192.168.23.3/32 is directly connected, Serial1/1
192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.34.0/24 is directly connected, Serial1/0
L 192.168.34.3/32 is directly connected, Serial1/0

====1上進行重發布,發現3上路由表出現了次優路徑的情況,去忘4.4.4.0網段
然後3上修改AD值
++++++

en
conf t
acc 4 per 4.4.4.0
router rip
dista 100 192.168.34.4 0.0.0.0 4
end

+++++
R3#
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

  2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/65] via 192.168.23.2, 00:21:53, Serial1/1
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [100/1] via 192.168.34.4, 00:00:19, Serial1/0
O 192.168.12.0/24 [110/128] via 192.168.23.2, 00:21:53, Serial1/1
O E2 192.168.14.0/24 [110/20] via 192.168.23.2, 00:08:50, Serial1/1
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, Serial1/1
L 192.168.23.3/32 is directly connected, Serial1/1
192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.34.0/24 is directly connected, Serial1/0
L 192.168.34.3/32 is directly connected, Serial1/0
R3#
R3#
再次查看路由表,發現次優路徑問題在
上已經修正
但因為是雙點雙向重發布,所以3上也需要配置重發布
-+-+-+-+-+-+-++--
en
conf t
router ospf 1
red rip subn
end
wr

配置完成後,查看R1的路由表
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

  2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/65] via 192.168.12.2, 00:27:10, Serial1/0
4.0.0.0/24 is subnetted, 1 subnets
O E2 4.4.4.0 [110/20] via 192.168.12.2, 00:00:18, Serial1/0
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, Serial1/0
L 192.168.12.1/32 is directly connected, Serial1/0
192.168.14.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.14.0/24 is directly connected, Serial1/1
L 192.168.14.1/32 is directly connected, Serial1/1
O 192.168.23.0/24 [110/128] via 192.168.12.2, 00:27:34, Serial1/0
O E2 192.168.34.0/24 [110/20] via 192.168.12.2, 00:00:18, Serial1/0
R1#
R1#
R1#

我們發現1上也出現了關於4.4.4.0網段的次優路徑問題

此時我們將1的來自4.4.4.0的路由的AD值修改
-------1
en
conf t
acc 4 per 4.4.4.0
router rip
dista 100 192.168.14.4 0.0.0.0 4
end

此時我們再次查看1的路由表

R1#show ip route

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

  2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/65] via 192.168.12.2, 00:32:27, Serial1/0
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [100/1] via 192.168.14.4, 00:00:02, Serial1/1
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, Serial1/0
L 192.168.12.1/32 is directly connected, Serial1/0
192.168.14.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.14.0/24 is directly connected, Serial1/1
L 192.168.14.1/32 is directly connected, Serial1/1
O 192.168.23.0/24 [110/128] via 192.168.12.2, 00:32:51, Serial1/0
O E2 192.168.34.0/24 [110/20] via 192.168.12.2, 00:05:35, Serial1/0
R1#
R1#
R1#

發現次優路徑問題也修正完成
然後查看網絡中其他設備的路由表

R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

  2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C 2.2.2.0/24 is directly connected, Loopback0
L 2.2.2.2/32 is directly connected, Loopback0
4.0.0.0/24 is subnetted, 1 subnets
O E2 4.4.4.0 [110/20] via 192.168.23.3, 00:05:52, Serial1/1
[110/20] via 192.168.12.1, 00:00:19, Serial1/0
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, Serial1/0
L 192.168.12.2/32 is directly connected, Serial1/0
O E2 192.168.14.0/24 [110/20] via 192.168.12.1, 00:18:17, Serial1/0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, Serial1/1
L 192.168.23.2/32 is directly connected, Serial1/1
O E2 192.168.34.0/24 [110/20] via 192.168.23.3, 00:05:52, Serial1/1
R2#
R2#
R2#
R2#

R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

  2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/65] via 192.168.23.2, 00:31:12, Serial1/1
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [100/1] via 192.168.34.4, 00:00:01, Serial1/0
O 192.168.12.0/24 [110/128] via 192.168.23.2, 00:31:12, Serial1/1
O E2 192.168.14.0/24 [110/20] via 192.168.23.2, 00:18:09, Serial1/1
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, Serial1/1
L 192.168.23.3/32 is directly connected, Serial1/1
192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.34.0/24 is directly connected, Serial1/0
L 192.168.34.3/32 is directly connected, Serial1/0
R3#
R3#
R3#
R3#
R3#

R4#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

  2.0.0.0/24 is subnetted, 1 subnets

R 2.2.2.0 [120/2] via 192.168.34.3, 00:00:16, Serial1/0
[120/2] via 192.168.14.1, 00:00:18, Serial1/1
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 4.4.4.0/24 is directly connected, Loopback0
L 4.4.4.4/32 is directly connected, Loopback0
R 192.168.12.0/24 [120/2] via 192.168.34.3, 00:00:16, Serial1/0
[120/2] via 192.168.14.1, 00:00:18, Serial1/1
192.168.14.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.14.0/24 is directly connected, Serial1/1
L 192.168.14.4/32 is directly connected, Serial1/1
R 192.168.23.0/24 [120/2] via 192.168.34.3, 00:00:16, Serial1/0
[120/2] via 192.168.14.1, 00:00:18, Serial1/1
192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.34.0/24 is directly connected, Serial1/0
L 192.168.34.4/32 is directly connected, Serial1/0
R4#
R4#
R4#
R4#

2與4之間的鏈路實現了負載均衡

感謝觀看,希望指出問題,我對這塊也只是初學者

ospf與rip雙點雙向重分發實驗-實現負載均衡