NAT―PAT(双线备份)


R1部分:

R1(config)#interface fastEthernet 0/0

R1(config-if)#ip addr 172.17.10.254 255.255.255.0

R1(config-if)#no sh


R1(config)#interface fastEthernet 0/1

R1(config-if)#ip addr 172.17.20.1 255.255.255.0

R1(config-if)#no sh


R1(config)#ip route 10.255.255.188 255.255.255.252 172.17.20.250

R1(config)#ip route 10.255.255.176 255.255.255.252 172.17.20.250




R2部分:

R2(config)#interface fastEthernet 2/1

R2(config-if)#ip addr 172.17.20.250 255.255.255.0

R2(config-if)#no sh


R2(config)#interface fastEthernet 2/0

R2(config-if)#ip addr 10.255.255.189 255.255.255.252

R2(config-if)#no sh


R2(config)#interface fastEthernet 1/0

R2(config-if)#ip addr 10.255.255.177 255.255.255.252

R2(config-if)#no sh


R2(config)#ip route 172.17.10.0 255.255.255.0 172.17.20.1




R3部分:

R3(config)#interface fastEthernet 2/0

R3(config-if)#ip addr 10.255.255.190 255.255.255.252

R3(config-if)#ip nat outside

R3(config-if)#no sh


R3(config)#interface fastEthernet 1/0

R3(config-if)#ip addr 10.255.255.178 255.255.255.252

R3(config-if)#ip nat outside

R3(config-if)#no sh


R3(config-if)#interface fastEthernet 0/0

R3(config-if)#ip addr 172.17.20.250 255.255.255.0

R3(config-if)#ip nat inside  

R3(config-if)#no sh


R3(config)#ip route 172.17.10.0 255.255.255.0 10.255.255.189

R3(config)#ip route 172.17.10.0 255.255.255.0 10.255.255.177 20

R3(config)#ip route 1.1.1.0 255.255.255.0 172.17.20.1



R3(config)#access-list 100 permit ip 1.1.1.0 0.0.0.255 any


R3(config)#route-map main_outside permit 10

R3(config-route-map)#match ip address 100

R3(config-route-map)#match interface fastEthernet 2/0


R3(config)#route-map backup_outside permit 10

R3(config-route-map)#match ip address 100

R3(config-route-map)#match interface fastEthernet 1/0



R3(config)#ip nat pool main 10.255.255.190 10.255.255.190 netmask 255.255.255.0

R3(config)#ip nat pool backup 10.255.255.178 10.255.255.178 netmask 255.255.255.0

R3(config)#ip nat inside source route-map main_outside pool main overload

R3(config)#ip nat inside source route-map backup_outside  pool backup overload

R3(config)#ip nat inside source static tcp 1.1.1.2 80 10.255.255.190 80 route-map main_outside extendable

R3(config)#ip nat inside source static tcp 1.1.1.2 80 10.255.255.178 80 route-map backup_outside extendable




R4部分:

R4(config)#interface fastEthernet 0/0

R4(config-if)#ip addr 172.17.20.1 255.255.255.0

R4(config-if)#no sh


R4(config)#interface fastEthernet 0/1

R4(config-if)#ip addr 1.1.1.1 255.255.255.0  

R4(config-if)#no sh


R4(config)#ip route 172.17.10.0 255.255.255.0 172.17.20.250





测试结果:






你可能感兴趣的:(NAT,pat)