(2)路由器的配置
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. 工作站的配置
要求使用静态IP地址,在TCP/IP属性中进行设置,并设置关网为192.168.0.3(路由器以太口IP地址),设置DNS为接入商提供的地址,浏览器等上网工具中无需作任何特殊设置。



网络工程师