配置nat server使公网能够访问私网
配置AR1 IP
[AR1]int g 0/0/0
[AR1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[AR1-GigabitEthernet0/0/0]int g 0/0/1
[AR1-GigabitEthernet0/0/1]ip add 10.1.12.1 24
配置FW1 IP
[FW1]int g 1/0/0
[FW1-GigabitEthernet1/0/0]ip add 10.1.12.2 24
[FW1-GigabitEthernet1/0/0]int g 1/0/1
[FW1-GigabitEthernet1/0/1]ip add 200.1.12.1 24
配置AR2 IP
[AR2]int g 0/0/0
[AR2-GigabitEthernet0/0/0]ip add 20.1.12.2 24
[AR2-GigabitEthernet0/0/0]int g 0/0/1
[AR2-GigabitEthernet0/0/1]ip add 200.1.23.254 24
配置区域
[FW1]firewall zone trust
[FW1-zone-trust]add int g 1/0/0
[FW1]firewall zone untrust
[FW1-zone-untrust]add int g 1/0/1
AR1 ospf:
[AR1]ospf 1
[AR1-ospf-1]a 1
[AR1-ospf-1-area-0.0.0.1]network 10.1.12.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255
FW1 ospf:
[FW1-ospf-1]a 1
[FW1-ospf-1-area-0.0.0.1]network 10.1.12.0 0.0.0.255
[FW1-ospf-1]default-route-advertise
Nat:
[FW1]nat server global 200.1.12.10 inside 192.168.1.1
安全策略
[FW1]security-policy
[FW1-policy-security-rule-u-t]source-zone untrust
[FW1-policy-security-rule-u-t]destination-zone trust
[FW1-policy-security-rule-u-t]destination-address 192.168.1.1 255.255.255.255
[FW1-policy-security-rule-u-t]action permit
PC ping nat端口
配置R3 IP:
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.1.3 24
[R3-GigabitEthernet0/0/0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.1.12.3 24
配置R4 IP:
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.1.4 24 [R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 10.1.23.4 24
配置R5 IP:
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 10.1.12.5 24
[R5-GigabitEthernet0/0/0]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip add 10.1.23.5 24
R5 配置loopback:
[R5]int LoopBack 0
[R5-LoopBack0]ip add 5.5.5.5 24
配置R3 OSPF:
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255 [R3-ospf-1-area-0.0.0.1]network 10.1.12.0 0.0.0.255
配置R4 OSPF:
[R4]ospf 1
[R4-ospf-1]a 1
[R4-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255
[R4-ospf-1-area-0.0.0.1]network 10.1.23.0 0.0.0.255
配置R5 OSPF:
[R5-GigabitEthernet0/0/1]q
[R5]ospf 1
[R5-ospf-1]a 1
[R5-ospf-1-area-0.0.0.1]network 10.1.12.0 0.0.0.255
[R5-ospf-1-area-0.0.0.1]network 10.1.23.0 0.0.0.255
[R5-ospf-1-area-0.0.0.1]network 5.5.5.5 0.0.0.0
配置R5 loopback:
[R5]int LoopBack 0
[R5-LoopBack0]ip add 5.5.5.5 24
配置R3 vrrp:
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[R3-GigabitEthernet0/0/0]vrrp vrid 1 priority 250
[R3-GigabitEthernet0/0/0]vrrp vrid 1 track interface g 0/0/1 reduce 160
配置R4 vrrp
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
破坏R3 R4 邻居关系:
[R3]ospf 1
[R3-ospf-1]silent-interface g 0/0/0
PC ping R5 loopback:
实现互通
关闭R3上行接口:
[R3]int g 0/0/1
[R3-GigabitEthernet0/0/1]shutdown
完成主备切换
关键代码指令以及过程已在上面给出,有问题欢迎留言讨论 ,对你有帮助点赞支持下呀~