1. 程式人生 > 實用技巧 >Zhi-nginx高可用 HA

Zhi-nginx高可用 HA

在這裡插入圖片描述
要求:r4所在部分為公網,r1-r3建立全連網狀拓撲,使用ospf所有私有網段互通
在這裡插入圖片描述
首先搭建公網環境,配置各個介面ip
[r1-GigabitEthernet0/0/2]ip address 14.1.1.1 24
[r1-LoopBack0]ip address 192.168.1.1 24
[r2-GigabitEthernet0/0/2]ip address 24.1.1.1 24
[r2-LoopBack0]ip ad 192.168.2.1 24
[r3-GigabitEthernet0/0/2]ip ad 34.1.1.1 24
[r3-LoopBack0]ip ad 192.168.3.1 24
[r4-GigabitEthernet0/0/0]ip address 14.1.1.2 24

[r4-GigabitEthernet0/0/1]ip address 24.1.1.2 24
[r4-GigabitEthernet0/0/2]ip address 34.1.1.2 24
然後開始做靜態路由,讓公網先通起來
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 14.1.1.1
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry 10.1.1.2 24.1.1.1 register
[r1-Tunnel0/0/0]nhrp entry 10.1.1.3 34.1.1.1 register
[r2-Tunnel0/0/0]ip address 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source 24.1.1.1
[r2-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]ip address 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 34.1.1.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.0
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1-area-0.0.0.0]network 10.1.1.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 192.168.3.1 0.0.0.0
[r2-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]nhrp entry multicast dynamic