注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 利用手机和电池实现反地心..
 帮助

内部服务器NAT和访问控制列表


2007-07-13 08:58:02
内部服务器NAT和访问控制列表
内部服务器
NAT 隐藏了内部网络的结构,具有“屏蔽”内部主机的作用,但是在实际应用中,可能需要提供给外部一个访问内部主机的机会,如提供给外部一个WWW的服务器,或是一台FTP 服务器。使用NAT 可以灵活地添加内部服务器
访问控制列表的基本步骤
启用防火墙
定义访问控制列表
将访问控制列表应用到接口上
 
实验目的:使内网的WWW服务器能被外网的用户所访问。
 
设备需求:1WWW服务器,1PC1QuidWay系列路由器。
 
配置概述:2PC配置好IP地址,指好网关,在路由器的LAN口上配置IP地址,做好服务器和公有IP的映射关系。
 
实验中需要的命令:
nat server protocol tcp global IP www  inside IP www
建立公有IP和私有IP的映射关系
acl number name
建立访问控制列表
firewall packet-filter 3000 inbound
在接口上应用访问控制列表
具体配置:
<Quidway>system-view
进入系统模式
[Quidway]sysname 2811-sy-01
为设备起名
[2811-sy-01]interface Ethernet 0/0
[2811-sy-01-Ethernet0/0]ip address 172.16.0.1 24
[2811-sy-01]interface ethernet 0/1
[2811-sy-01-Ethernet0/1]ip address 202.10.1.1 24
进入接口模式并配置相应的IP地址
[2811-sy-01-Ethernet0/1]nat server protocol tcp global 202.10.1.150  www  inside 172.16.0.2 www
做一条公有的IP地址与服务器的私有IP的映射关系
[2811-sy-01]acl number 3000
建立一个扩展访问控制列表   
[2811-sy-01-acl-adv-3000]rule permit tcp source any destination 202.10.1.150 0 destination-port eq www
定义一条规则允许所有的外网IP访问内网的端口号是80的服务器
[2811-sy-01-acl-adv-3000]rule deny icmp source any destination any
定义一条规则拒绝所有的外网IP访问内网
[2811-sy-01]firewall enable
开启防火墙                          
[2811-sy-01]interface ethernet 0/1                                 
[2811-sy-01-Ethernet0/1]firewall packet-filter 3000 inbound
在接口上应用访问控制列表
 
 
验证:
[2811-sy-01]display nat all
NAT address-group information:
  No address-groups have been configured
NAT outbound information:
  No interfaces have been configured for NAT
Server in private network information:
  Interface:Ethernet0/1, Protocol:6(tcp),
     [global]     202.10.1.150:   80(www)   [local]       172.16.0.2:   80(www)
NAT aging-time value information:各种协议没有数据通过时自动断开的时间
       tcp ---- aging-time value is  86400 (seconds)
       udp ---- aging-time value is    300 (seconds)
       icmp ---- aging-time value is     60 (seconds)
       pptp ---- aging-time value is  86400 (seconds)
       dns ---- aging-time value is     60 (seconds)
       tcp-fin ---- aging-time value is     60 (seconds)
       tcp-syn ---- aging-time value is     60 (seconds)
      ftp-ctrl ---- aging-time value is   7200 (seconds)
      ftp-data ---- aging-time value is    300 (seconds)
 
[2811-sy-01]display nat server
Server in private network information:
  Interface:Ethernet0/1, Protocol:6(tcp),
     [global]     202.10.1.150:   80(www)   [local]       172.16.0.2:   80(www)
查看内部服务器的信息
 
我们可以访问内网的WWW服务器。
 






    文章评论
 
2007-07-13 09:21:08
高手,顶 !

2007-07-13 09:24:44
厉害啊~~~

2007-07-13 09:30:31
我看不懂!

2007-08-15 11:25:08
有点用处,可是那个验证就这样而已么,能说明些什么啊?

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: