分类:
2012-07-09 16:35:02
的设置步骤:
一、配置动态NAT转换的地址池
二、配置动态NAT地址映射IP NAT INSIDE SOURCE LIST 1 POOL NAT
三、访问列表设定内部地址范围
R1(config)#int f1/0
R1(config-if)#no ip inside
R1(config-if)#int s2/0
R1(config-if)#no ip nat outside
R1(config-if)#
R1(config-if)#exit
R1(config)#ip nat pool nat 202.96.1.3 202.96.1.100 netmask 255.255.255.0
R1(config)#ip nat inside source list 1 pool nat
R1(config)#
R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255
R1(config)#interface f1/0
R1(config-if)#ip nat inside
R1(config-if)#int s2/0
R1(config-if)#ip nat outside
R1(config-if)#exit
R1(config)#
R1(config)#exit
R1#debug ip nat
IP NAT debugging is on
R1#
*Nov 22 17:32:14.855: NAT: s=192.168.1.2->202.96.1.3, d=2.2.2.2 [15]
*Nov 22 17:32:14.963: NAT*: s=2.2.2.2, d=202.96.1.3->192.168.1.2 [15]
*Nov 22 17:32:15.011: NAT*: s=192.168.1.2->202.96.1.3, d=2.2.2.2 [16]
*Nov 22 17:32:15.043: NAT*: s=2.2.2.2, d=202.96.1.3->192.168.1.2 [16]
*Nov 22 17:32:15.135: NAT*: s=192.168.1.2->202.96.1.3, d=2.2.2.2 [17]
*Nov 22 17:32:15.151: NAT*: s=2.2.2.2, d=202.96.1.3->192.168.1.2 [17]
*Nov 22 17:32:15.199: NAT*: s=192.168.1.2->202.96.1.3, d=2.2.2.2 [18]
*Nov 22 17:32:15.215: NAT*: s=2.2.2.2, d=202.96.1.3->192.168.1.2 [18]
*Nov 22 17:32:15.243: NAT*: s=192.168.1.2->202.96.1.3, d=2.2.2.2 [19]
R1#
*Nov 22 17:32:15.259: NAT*: s=2.2.2.2, d=202.96.1.3->192.168.1.2 [19]
R1#sh ip nat trans
R1#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 202.96.1.3 192.168.1.2 --- ---
R1#
*Nov 22 17:32:38.619: NAT: s=192.168.1.1->202.96.1.4, d=2.2.2.2 [10]
*Nov 22 17:32:38.683: NAT*: s=2.2.2.2, d=202.96.1.4->192.168.1.1 [10]
*Nov 22 17:32:38.759: NAT*: s=192.168.1.1->202.96.1.4, d=2.2.2.2 [11]
*Nov 22 17:32:38.791: NAT*: s=2.2.2.2, d=202.96.1.4->192.168.1.1 [11]
*Nov 22 17:32:38.807: NAT*: s=192.168.1.1->202.96.1.4, d=2.2.2.2 [12]
*Nov 22 17:32:38.839: NAT*: s=2.2.2.2, d=202.96.1.4->192.168.1.1 [12]
*Nov 22 17:32:38.871: NAT*: s=192.168.1.1->202.96.1.4, d=2.2.2.2 [13]
*Nov 22 17:32:38.899: NAT*: s=2.2.2.2, d=202.96.1.4->192.168.1.1 [13]
*Nov 22 17:32:38.947: NAT*: s=192.168.1.1->202.96.1.4, d=2.2.2.2 [14]
R1#
*Nov 22 17:32:38.963: NAT*: s=2.2.2.2, d=202.96.1.4->192.168.1.1 [14]
R1#sh ip nat trans
R1#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 202.96.1.3 192.168.1.2 --- ---
--- 202.96.1.4 192.168.1.1 --- ---
R1#sh ip nat statistics
Total active translations: 2 (0 static, 2 dynamic; 0 extended)
Outside interfaces:
Serial2/0
Inside interfaces:
FastEthernet1/0
Hits: 28 Misses: 2
Expired translations: 0
Dynamic mappings:
-- Inside Source
[Id: 1] access-list 1 pool nat refcount 2
pool nat: netmask 255.255.255.0
start 202.96.1.3 end 202.96.1.100
type generic, total addresses 98, allocated 2 (2%), misses 0
R1#