一、静态NAT的配置

1、设置外部端口的IP地址

2、设置内部端口的IP地址

3、在内部局部地址和外部全局地址之间建立静态地址转换

router(config)#ip nat inside sourcestatic   local-ip   global-ip

router(config)#ip nat inside source static192.168.1.2 61.159.62.130
(
将内部局部地址192.168.1.2 转换为内部全局地址 61.159.62.130 )

4、在内部和外部端口上启用NAT

router(config)#interface serial 0/0
router(config-if)#ip nat outside
router(config)#interface fastethernet 0/0
router(config-if)#ip nat inside

二、动态NAT的配置

1、设置外部端口的IP地址

2、设置内部端口的IP地址

3、定义内部网络中允许访问外部网络的访问控制列表

router(config)#access-list 1 permit 102.168.1.0 0.0.0.255

4、定义合法IP地址池

router(config)#ip nat pool pool-name star-ipend-ip netmask [type rotary]
pool-name: