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

内部服务器NAT和访问控制列表
内部服务器
NAT 隐藏了内部网络的结构,具有“屏蔽”内部主机的作用,但是在实际应用中,可能需要提供给外部一个访问内部主机的机会,如提供给外部一个WWW的服务器,或是一台FTP 服务器。使用NAT 可以灵活地添加内部服务器
访问控制列表的基本步骤
启用防火墙 定义访问控制列表 将访问控制列表应用到接口上
实验目的:使内网的WWW服务器能被外网的用户所访问。
设备需求:1台WWW服务器,1台PC,1台QuidWay系列路由器。
配置概述:将2台PC配置好IP地址,指好网关,在路由器的LAN口上配置IP地址,做好服务器和公有IP的映射关系。
实验中需要的命令:
nat server protocol tcp global IP wwwinside IP www
建立公有IP和私有IP的映射关系 acl number name
建立访问控制列表 firewall packet-filter 3000 inbound
在接口上应用访问控制列表 具体配置:
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.150wwwinside 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 在接口上应用访问控制列表

【内部服务器NAT和访问控制列表】
验证:
[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 is86400 (seconds) udp ---- aging-time value is300 (seconds) icmp ---- aging-time value is60 (seconds) pptp ---- aging-time value is86400 (seconds) dns ---- aging-time value is60 (seconds) tcp-fin ---- aging-time value is60 (seconds) tcp-syn ---- aging-time value is60 (seconds) ftp-ctrl ---- aging-time value is7200 (seconds) ftp-data ---- aging-time value is300 (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服务器。

转载于:https://blog.51cto.com/wangwei0411/33852

    推荐阅读