PAT configuration experiment
I. commands related to PAT configuration
1. Define access control lists:
Router (config) # access-list 1 permit 10.1.1.0 0.0.0.255
two。 Define a legal IP address pool:
Router (config) # ip nat pool onlyone 61.159.62.131 61.159.62.131 netmask 255.255.255.248
3. Implement network address translation:
Router (config) # ip nat insde source list 1 pool onlyone overload
4. Enable NAT on internal and external ports and configure default routes: the same as static NAT
5. Define internal access lists:
Router (config) # access-list 1 permit 10.1.1.0 0.0.0.255
6. Define a legitimate IP address pool:
Because the external interface address is used directly, the IP address pool is no longer defined
7. Example of setting up a reuse dynamic IP address translation command:
Router (config) # ip nat inside source list 1 interface FastEthernet 0 overload 0, PAT configuration experiment diagram
1. Host configuration address
PC1 > ip 192.168.100.10 192.168.100.1Checking for duplicate address...PC1: 192.168.100.10 255.255.255.0 gateway 192.168.100.1PC2 > ip 192.168.100.20 192.168.100.1Checking for duplicate address...PC1: 192.168.100.20 255.255.255.0 gateway 192.168.100.1PC3 > ip 12.0.0.12 12.0.0.1Checking for duplicate address...PC1: 12.0.0. 12 255.255.255.0 gateway 12.0.0.1
2. Configure the switch
Sw#conf tsw (config) # no ip routingsw (config) # int F1 ex 0 sw (config-if) # speed 100sw (config-if) # dup fullsw (config-if) # ex
3. Configure the PAT list on the route
R1#conf tR1 (config) # int f0/0R1 (config-if) # ip add 192.168.100.1 255.255.255.0R1 (config-if) # no shutR1 (config-if) # int f0/1R1 (config-if) # ip add 12.0.0.1 255.255.255.0R1 (config-if) # no shutR1 (config-if) # exR1 (config) # access-list 1 permit 192.168.100.0 0.0.0.255R1 (config) # ip nat inside source List 1 interface fastEthernet 0bat 1 overload R1 (config) # int f0/0R1 (config-if) # ip nat insideR1 (config-if) # int f0/1R1 (config-if) # ip nat outsideR1 (config-if) # endR1#debug ip nat # turn on NAT debugging in privileged mode View the specific debugging process IP NAT debugging is on when ping
4. Test whether the list is configured correctly
PC1 > ping 12.0.0.12-t 12.0.0.12 icmp_seq=1 timeout84 bytes from 12.0.0.12 icmp_seq=2 ttl=63 time=31.424 ms84 bytes from 12.0.0.12 icmp_seq=3 ttl=63 time=31.560 ms84 bytes from 12.0.0.12 icmp_seq=4 ttl=63 time=31.278 ms84 bytes from 12.0.0.12 icmp_seq=5 ttl=63 time=39.174 msR1#*Mar 1 00 icmp_seq=1 timeout84 bytes from 12 39.347 : NAT: 192.168.100.10-> 12.0.0.1 Dong12.0.0.12 [48340] # you can see the translation from 192.168.100.10 to 12.0.0.1 in R1 at this time, the public network address PC2 > ping 12.0.0.12-t 84 bytes from 12.0.0.12 icmp_seq=1 ttl=63 time=31.402 ms84 bytes from 12.0.0.12 icmp_seq=2 ttl=63 time=33.339 ms84 bytes from 12.0.0 .12 icmp_seq=3 ttl=63 time=38.074 msR1#*Mar 100: 15 17.887: NAT*: slots 192.168.100.20-> 12.0.0.1 Dong12.0.0.12 [48502] # at this time, you can see that 192.168.100.20 has also been translated into 12.0.0.1 as a public network address in R1.
Summary:
1. PAT is the most widely used list configuration method in enterprises, which greatly saves the resource exhaustion of available public network IP addresses.