NAT-PAT

-------------------------------上 海-------------------------------


100839319.jpg

100841682.jpg



S1(config)#vlan 10

S1(config)#interface fastEthernet 0/1
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 10
S1(config-if)#no sh

S1(config)#interface vlan 10
S1(config-if)#ip address 172.17.10.254 255.255.255.0
S1(config-if)#no sh

S1(config)#interface vlan 10
S1(config-if)#ip address 172.17.10.254 255.255.255.0
S1(config-if)#no sh

S1(config)#ip routing
S1(config)#ip route 1.1.1.1 255.255.255.255 172.17.22.250


R1(config)#interface gigabitEthernet 0/2
R1(config-if)#ip addr 172.17.22.250 255.255.255.0
R1(config-if)#no sh

R1(config)#ip route 172.17.10.0 255.255.255.0 172.17.22.254


R1#ping 172.17.10.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.10.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms




-------------------------------上海至北京-------------------------------


R1(config)#interface gigabitEthernet 0/0
R1(config-if)#ip address 10.255.255.189 255.255.255.252
R1(config-if)#ip nat inside
R1(config-if)#no sh

R1(config)#interface gigabitEthernet 0/1
R1(config-if)#ip address 10.255.255.177 255.255.255.252
R1(config-if)#ip nat inside
R1(config-if)#no sh

R1(config)#interface gigabitEthernet 0/2
R1(config-if)#ip nat outside

R1(config)#ip access-list standard From_BJ
R1(config-std-nacl)#permit 192.168.1.0 0.0.0.255

R1(config)#ip nat inside source list From_BJ interface gigabitEthernet 0/2 overload
R1(config)#ip nat inside source static tcp 1.1.1.1 80 172.17.22.250 80

R1(config)#ip route 192.168.1.0 255.255.255.0 10.255.255.190
R1(config)#ip route 192.168.1.0 255.255.255.0 10.255.255.178 5
R1(config)#ip route 1.1.1.1 255.255.255.255 10.255.255.190
R1(config)#ip route 1.1.1.1 255.255.255.255 10.255.255.178 5

R2(config)#interface gigabitEthernet 0/0
R2(config-if)#ip address 10.255.255.190 255.255.255.252
R2(config-if)#ip nat outside
R2(config-if)#no sh

R2(config)#interface gigabitEthernet 0/1
R2(config-if)#ip address 10.255.255.178 255.255.255.252
R2(config-if)#ip nat outside
R2(config-if)#no sh

R2(config)#interface loopback 0
R2(config-if)#ip addr 1.1.1.1 255.255.255.255
R2(config-if)#no sh

R2(config)#ip nat inside source static tcp 192.168.1.10 80 1.1.1.1 80

R2(config)#ip route 172.17.10.0 255.255.255.0 10.255.255.189
R2(config)#ip route 172.17.10.0 255.255.255.0 10.255.255.177 5




-------------------------------北 京-------------------------------


R2(config)#interface gigabitEthernet 0/2
R2(config-if)#ip address 192.168.22.250 255.255.255.0
R2(config-if)#ip nat inside
R2(config-if)#no sh

R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.22.254


S2(config)#interface gigabitEthernet 0/2
S2(config-if)#no switchport
S2(config-if)#ip address 192.168.22.254 255.255.255.0
S2(config-if)#no sh

S2(config)#interface vlan 10
S2(config-if)#ip address 192.168.1.254 255.255.255.0
S2(config-if)#no sh

S2(config)#interface fastEthernet 0/1
S2(config-if)#switchport mode access
S2(config-if)#switchport access vlan 10
S2(config-if)#no sh

S2(config)#ip routing
S2(config)#ip route 10.255.255.0 255.255.255.0 192.168.22.250
S2(config)#ip route 172.17.10.0 255.255.255.0 192.168.22.250



101005143.jpg

101007427.jpg





-------------------------------测 试-------------------------------



101148860.jpg

101150764.jpg

101153624.jpg



101155664.jpg

101157602.jpg




R1(config)#interface gigabitEthernet 0/0
R1(config-if)#shut


101310339.jpg

101312833.jpg

101314688.jpg





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