强叔侃墙 校园网出口网关配置Word格式文档下载.docx
《强叔侃墙 校园网出口网关配置Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《强叔侃墙 校园网出口网关配置Word格式文档下载.docx(10页珍藏版)》请在冰豆网上搜索。
![强叔侃墙 校园网出口网关配置Word格式文档下载.docx](https://file1.bdocx.com/fileroot1/2023-1/3/ba083b9b-2ea1-4ea2-84f5-42725e162c1d/ba083b9b-2ea1-4ea2-84f5-42725e162c1d1.gif)
1、配置各接口的IP地址。
接口的配置我想大家都会的,所以强叔这里只给出GE1/0/0的配置了。
本举例中的接口都为10GE接口。
【强叔点评】一般ISP分配给你的IP地址都是30位掩码的。
建议在接口上配置描述或别名,表示接口的情况。
<
USG>
system-view
[USG]interfaceGigabitEthernet1/0/0
[USG-GigabitEthernet1/0/0]ipaddress218.1.1.1255.255.255.252
[USG-GigabitEthernet1/0/0]descriptiontocernet
[USG-GigabitEthernet1/0/0]quit
#
hrpmirrorsessionenable
hrpenable
hrpospf-costadjust-enable
hrploadbalance-device
hrpinterfaceGigabitEthernet1/0/7
interfaceGigabitEthernet1/0/1
ipaddress10.2.0.1255.255.255.0
hrptrackactive
hrptrackstandby
interfaceGigabitEthernet1/0/3
ipaddress10.3.0.1255.255.255.0
interfaceGigabitEthernet1/0/7
ipaddress10.10.0.1255.255.255.0
2、创建安全区域,并将各接口加入安全区域。
新建安全区域isp1、isp2和cernet(代表教育网),并将各接口加入对应的安全区域。
【强叔点评】当防火墙需要连接多个ISP时,一般需要为每个连接ISP的接口都创建一个新的安全区域,而且安全区域的名称最好能够代表此安全区域。
[USG]firewallzonenameisp1
[USG-zone-isp1]setpriority15
[USG-zone-isp1]addinterfaceGigabitEthernet1/0/1
[USG-zone-isp1]quit
[USG]firewallzonenameisp2
[USG-zone-isp2]setpriority20
[USG-zone-isp2]addinterfaceGigabitEthernet1/0/2
[USG-zone-isp2]quit
[USG]firewallzonenamecernet
[USG-zone-cernet]setpriority25
[USG-zone-cernet]addinterfaceGigabitEthernet1/0/0
[USG-zone-cernet]quit
[USG]firewallzonetrust
[USG-zone-trust]addinterfaceGigabitEthernet1/0/3
[USG-zone-trust]quit
3、配置IP-Link,探测各ISP提供的链路状态是否正常。
[USG]ip-linkcheckenable
[USG]ip-link1destination218.1.1.2interfaceGigabitEthernet1/0/0
[USG]ip-link2destination200.1.1.2interfaceGigabitEthernet1/0/1
[USG]ip-link3destination202.1.1.2interfaceGigabitEthernet1/0/2
【强叔点评】当IP-Link监控的链路故障时,与其绑定的静态路由或策略路由失效。
4、配置静态路由,保证基础路由可达。
配置缺省路由,下一跳为教育网的地址,保证未匹配其他路由的流量都能够通过教育网转发出去。
[USG]iproute-static0.0.0.00.0.0.0218.1.1.1
配置静态路由,目的地址为内网网段,下一跳为内网交换机的地址,保证外网的流量能够到达内网。
[USG]iproute-static10.1.0.0255.255.0.0172.16.1.2
【强叔点评】当在网关上配置静态路由时,既要有出方向的路由,也要有入方向的路由。
一般情况下,出方向都会至少配置一条缺省路由。
5、配置ISP选路,保证去往特定目的地址的流量能够通过特定链路(接口)转发。
1)从各ISP获取最新的目的地址明细。
2)按如下格式分别编辑各ISP的csv文件。
3)导入所有ISP的csv文件。
4)执行以下命令,分部加载各ISP的csv文件,并指定下一跳。
[USG]ispsetfilenamecsnet.csvGigabitEthernet1/0/0next-hop218.1.1.2trackip-link1
[USG]ispsetfilenameisp1.csvGigabitEthernet1/0/1next-hop200.1.1.2trackip-link2
[USG]ispsetfilenameisp2.csvGigabitEthernet1/0/2next-hop202.1.1.2trackip-link3
【强叔点评】ISP选路功能其实就是批量下发明细路由,目的地址为ISP文件中的地址,下一跳为配置命令指定的地址。
ISP选路能够实现去往特定ISP目的地址的流量都通过对应的ISP链路转发。
各位小伙伴注意,ISP选路功能是USG9000系列V300R001C20版本的新功能噢。
6、配置策略路由,保证特定内网用户(IP)的流量能够通过特定链路(接口)转发。
【强叔点评】策略路由的作用是基于源IP地址的选路(当然通过高级ACL也能实现基于目的地址的选路)。
例如图书管的上网用户(10.1.2.0/24网段)只能通过教育网访问Internet。
策略路由的配置方式是华为经典的CB对(classifier和behavior配对)配置方式。
[USG]aclnumber2000
[USG-acl-basic-2000]rulepermitsource10.1.2.00.0.0.255
[USG-acl-basic-2000]quit
[USG]trafficclassifierclasslb
[USG-classifier-classlb]if-matchacl2000
[USG-classifier-classlb]quit
[USG]trafficbehaviorbehaviorlb
[USG-behavior-behaviorlb]redirectip-nexthop218.1.1.2interfaceGigabitEthernet1/0/0trackip-link1
[USG-behavior-behaviorlb]quit
[USG]trafficpolicypolicylb
[USG-trafficpolicy-policylb]classifierclasslbbehaviorbehaviorlb
[USG-trafficpolicy-policylb]quit
[USG]interfaceGigabitEthernet1/0/3
[USG-GigabitEthernet1/0/3]traffic-policypolicylbinbound
[USG-GigabitEthernet1/0/3]quit
7、配置安全策略和IPS,保证流量能够正常转发的同时,进行入侵行为检测。
开启trust与isp1、isp2、csnet间的安全策略,并引用缺省的配置文件ids,进行入侵行为检测。
下面仅以trust与isp1间的安全策略配置为例。
[USG]policyinterzonetrustisp1outbound
[USG-policy-interzone-trust-isp1-outbound]policy0
[USG-policy-interzone-trust-isp1-outbound-0]actionpermit
[USG-policy-interzone-trust-isp1-outbound-0]profileipsids
[USG-policy-interzone-trust-isp1-outbound-0]quit
[USG]policyinterzonetrustisp1inbound
[USG-policy-interzone-trust-isp1-inbound]policy0
[USG-policy-interzone-trust-isp1-inbound-0]actionpermit
[USG-policy-interzone-trust-isp1-inbound-0]profileipsids
[USG-policy-interzone-trust-isp1-inbound-0]quit
启用IPS功能,并配置特征库定时在线升级。
[USG]ipsenable
[USG]updatescheduleips-sdbenable
[USG]updatescheduleweeklysun02:
00
[USG]updateschedulesa-sdbenable
[USG]updatescheduleweeklysun03:
[USG]undoupdateconfirmips-sdbenable
[USG]undoupdateconfirmsa-sdbenable
【强叔点评】当防火墙作网关且网络对安全性要求不高时,可以配置域间的安全策略动作为允许。
通过在安全策略上引用入侵防御配置文件可以实现安全区域间流量的入侵防御。
USG缺省存在配置文件default和ids。
配置文件default用于入侵行为检测并阻断,配置文件ids用于入侵行为检测并告警(不阻断)。
8、配置源NAT,保证多个内网用户能够同时访问外网。
需要分别在trust与isp1、isp2、csnet间配置源NAT,下面仅以trust与isp1间的源NAT配置为例。
NAT地址池中的地址是从ISP获取的。
[USG]nataddress-groupisp1
[USG-address-group-isp1]modepat
[USG-address-group-isp1]section200.1.1.10200.1.1.12
[USG-address-group-isp1]quit
[USG]nat-policyinterzonetrustisp1outbound
[USG-nat-policy-interzone-trust-isp1-outbound]policy0
[USG-nat-policy-interzone-trust-isp1-outbound-0]actionsource-nat
[USG-nat-policy-interzone-trust-isp1-outbound-0]address-groupisp1
[USG]iproute-static200.1.1.1032NULL0
[USG]iproute-static200.1.1.1132NULL0
[USG]iproute-static200.1.1.1232NULL0
【强叔点评】源NAT和NATServer都必须配置黑洞路由。
9、配置基于zone的NATServer,使外网用户能够访问内网服务器。
一般情况下一台服务器的私网IP会映射成多个ISP的公网地址,供各个ISP的用户访问。
下面以其中一台图书馆服务器10.1.10.10为例配置基于zone的NATServer。
[USG]natserver1zoneisp1global200.1.10.10inside10.1.10.10descriptionlb-isp1
[USG]natserver1zoneisp2global202.1.10.10inside10.1.10.10descriptionlb-isp2
[USG]natserver1zonecsnetglobal218.1.10.10inside10.1.10.10descriptioncsnet
[USG]iproute-static218.1.10.1032NULL0
10、配置智能DNS,使各个ISP的外网用户都能够使用自己所在的ISP地址访问内网服务器。
智能DNS的作用是确保各个ISP的用户访问学校的服务器时,都能够解析到自己ISP的地址,从而提高访问速度。
例如ISP1的用户通过域名访问图书馆服务器10.1.10.10时,会解析到服务器的ISP1地址200.1.10.10。
【强叔点评】使用智能DNS的前提是内网部署了DNS服务器(本案例仅以10.1.10.20为例)。
智能DNS将分配给每个ISP的服务器地址与连接ISP的出接口绑定。
各位小伙伴注意,智能DNS功能是USG9000系列V300R001C20版本的新功能噢~
[USG]dnsresolve
[USG]dnsserver10.1.10.20
[USG]dns-smartenable
[USG]dns-smartgroup1typesingle
[USG-dns-smart-group-1]descriptionlb
[USG-dns-smart-group-1]real-server-ip10.1.10.10
[USG-dns-smart-group-1]out-interfaceGigabitEthernet1/0/0map218.1.10.10
[USG-dns-smart-group-1]out-interfaceGigabitEthernet1/0/1map200.1.10.10
[USG-dns-smart-group-1]out-interfaceGigabitEthernet1/0/2map202.1.10.10
11、配置攻击防范,保护内部网络安全。
[USG]firewalldefendlandenable
[USG]firewalldefendsmurfenable
[USG]firewalldefendfraggleenable
[USG]firewalldefendwinnukeenable
[USG]firewalldefendsource-routeenable
[USG]firewalldefendroute-recordenable
[USG]firewalldefendtime-stampenable
[USG]firewalldefendping-of-deathenable
[USG]firewalldefendsyn-floodenable
[USG]firewalldefendsyn-floodinterfaceGigabitEthernet1/0/0max-rate24000tcp-proxyauto
[USG]firewalldefendsyn-floodinterfaceGigabitEthernet1/0/1max-rate24000tcp-proxyauto
[USG]firewalldefendsyn-floodinterfaceGigabitEthernet1/0/2max-rate24000tcp-proxyauto
【强叔点评】一般情况下,如果对网络安全没有特殊要求,开启以上攻击防范即可。
对于synflood攻击防范,建议10GE接口阈值取值16000pps。
本案例的接口都是10GE接口,之所以取值为24000pps,也是实际试验的结果。
因为实际经验往往是配置较大的阈值,然后一边观察一边调小阈值,直到调整到合适的范围(既很好的限制了攻击,又不影响正常业务)。
12、配置带宽管理,限制网络的P2P流量。
【强叔点评】带宽管理的配置方法是先创建带宽通道(也就是指定各种限流动作),然后在带宽策略中引用带宽通道。
需要特别注意的是上传、下载的方向与outbound、inbound的关系。
另外一般情况下建议限制P2P流量到网络总流量的20%到30%。
各位小伙伴注意,带宽管理功能是USG9000系列V300R001C20版本的新功能噢~
[USG]car-classp2p_all_download
[USG-car-class-p2p_all_download]car-modeper-ip
[USG-car-class-p2p_all_download]cir100000
[USG-car-class-p2p_all_download]cir4000000total
[USG-car-class-p2p_all_download]quit
[USG]car-classp2p_all_upload
[USG-car-class-p2p_all_upload]car-modeper-ip
[USG-car-class-p2p_all_upload]cir100000
[USG-car-class-p2p_all_upload]cir4000000total
[USG-car-class-p2p_all_upload]quit
[USG]car-policyzonetrustinbound
[USG-car-policy-zone-trust-inbound]policy0
[USG-car-policy-zone-trust-inbound-0]policyapplicationcategoryp2p
[USG-car-policy-zone-trust-inbound-0]actioncar
[USG-car-policy-zone-trust-inbound-0]car-classp2p_all_download
[USG-car-policy-zone-trust-inbound-0]descriptionp2p_limit_download
[USG-car-policy-zone-trust-inbound-0]quit
[USG]car-policyzonetrustoutbound
[USG-car-policy-zone-trust-outbound]policy0
[USG-car-policy-zone-trust-outbound-0]policyapplicationcategoryp2p
[USG-car-policy-zone-trust-outbound-0]actioncar
[USG-car-policy-zone-trust-outbound-0]car-classp2p_all_upload
[USG-car-policy-zone-trust-outbound-0]descriptionp2p_limit_upload
[USG-car-policy-zone-trust-outbound-0]quit
13、配置日志和NAT溯源功能,在网管系统eSight上查看日志。
配置USG向日志主机(10.1.10.30)发送系统日志(本案例发送IPS日志和攻击防范日志)。
[USG]info-centerenable
[USG]enginelogipsenable
[USG]info-centersourceipschannelloghostloglevelemergencies
[USG]info-centersourceANTIATTACKchannelloghost
[USG]info-centerloghost10.1.10.30
配置USG向日志主机(10.1.10.30)发送会话日志(端口9002)。
这里需要在trust与isp、isp2、csnet间的双方向都配置审计策略。
本案例仅以trust与isp1间的outbound方向的审计策略为例。
[USG]firewalllogsource172.16.1.19002
[USG]firewallloghost210.1.10.309002
[USG]audit-policyinterzonetrustisp1outbound
[USG-audit-policy-interzone-trust-isp1-outbound]policy0
[USG-audit-policy-interzone-trust-isp1-o