en config t ip nat pool c2610 211.90.139.41 211.90.139.42 netmask 255.255.255.252 (定义一个地址池c2601,其内包含了两个空闲的合法IP地址,供NAT转换时使用) int e0/0 ip address 192.168.0.3 255.255.255.0 ip nat inside exit
(设置以太口的IP地址,并设置其为连接内部网的端口)
interface s0/0 ip address 211.90.137.25 255.255.255.252 ip nat outside exit (设置广域网端口的IP地址,并设置其为连接外部网的端口) ip route 0.0.0.0 0.0.0.0 211.90.137.26 (设置动态路由) access-list 2 permit 192.168.0.1 0.0.0.255 (建立访问控制列表) ! Dynamic NAT ! ip nat inside source list 2 pool c2610 overload (建立动态地址翻译) line console 0 exec-timeout 0 0 ! line vty 0 4 end wr (保存所作的设置) 3. 工作站的配置
en config t int e0/0 ip address 211.90.139.41 255.255.255.252 exit (设置以太口的IP地址) interface s0/0 ip address 211.90.137.25 255.255.255.252 exit (设置广域网端口的IP地址) ip route 0.0.0.0 0.0.0.0 211.90.137.26 ip routing (设置动态路由,并激活路由) end wr (保存所作的设置)