![](https://i-blog.csdnimg.cn/blog_migrate/c62e48a636dcf9b3bda69d28dc43f743.jpeg)
在NAT Internet User 路由中配置静态路由,使NAT路由器和Internet User之间相互通信<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Internet(config)#ip route <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />0.0.0.0 0.0.0.0. 20.1.1.2
User(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2
NAT (config)#ip route 3.3.3.0 255.255.255.0 10.1.1.1
NAT (config)#ip route 1.1.1.0 255.255.255.0 20.1.1.1
在使NAT路由器上配置静态NAT
NAT(config)#ip nat inside sostatic 10.1.1.1 20.1.1.2
NAT(config)#int s 2/3
NAT(config-if)#ip nat inside
NAT(config)#int s 2/1
NAT(config-if)#ip nat outside
在使Internet路由器上debug查看
Internet#
00:34:06: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.2
00:34:06: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.2
00:34:06: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.2
00:34:06: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.2
00:34:06: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.2
在使NAT路由器上配置PAT
NAT(config)#access-list 1 permit 10.1.1.0 0.0.0.255
NAT(config)#ip nat inside source lis 1 interface s 2/1 overload
NAT(config)#int s 2/3
NAT(config-if)#ip nat inside
NAT(config)#int s 2/1
NAT(config-if)#ip nat outside
在使Internet路由器上debug查看
Internet#
00:32:02: ICMP: echo reply sent, src 1.1.1.1, dst 10.1.1.1
Internet#
00:32:04: ICMP: echo reply sent, src 1.1.1.1, dst 10.1.1.1
Internet#
00:32:06: ICMP: echo reply sent, src 1.1.1.1, dst 10.1.1.1
Internet#
00:32:08: ICMP: echo reply sent, src 1.1.1.1, dst 10.1.1.1
Internet#
00:32:10: ICMP: echo reply sent, src 1.1.1.1, dst 10.1.1.1
在使NAT路由器上配置静态NAT
NAT(config)#ip nat pool NAT 20.1.1.3 20.1.1.7 netmask 255.255.255.248
NAT(config)#ip nat inside source lis的t 1 pool NAT
NAT(config)#int s 2/3
NAT(config-if)#ip nat inside
NAT(config)#int s 2/1
NAT(config-if)#ip nat outside
在使Internet路由器上debug查看
Internet#
00:39:04: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.3
00:39:04: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.3
00:39:04: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.3
00:39:04: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.3
00:39:04: ICMP: echo reply sent, src 1.1.1.1, dst 20.1.1.3
转载于:https://blog.51cto.com/davidsergeant/65982