第一部分华为防火墙基本初始化LAB1子接口初始化一、实验拓扑二、基本配置SW:[SW]vlan2[SW-vlan2]descriptionUntrust[SW-vlan2]vlan3[SW-vlan3]descriptionTrust[SW-vlan3]vlan4[SW-vlan4]descriptionDMZ[SW]intg0/0/9[SW-GigabitEthernet0/0/8]portlink-typeaccess[SW-GigabitEthernet0/0/8]portdefaultvlan3[SW-GigabitEthernet0/0/8]intg0/0/3[SW-GigabitEthernet0/0/3]portlink-typeaccess[SW-GigabitEthernet0/0/3]portdefaultvlan3[SW]intg0/0/9[SW-GigabitEthernet0/0/9]portlink-typetrunk[SW-GigabitEthernet0/0/9]porttrunkallow-passvlan124[SW]intg0/0/1[SW-GigabitEthernet0/0/1]portlink-typeaccess[SW-GigabitEthernet0/0/1]portdefaultvlan2[SW-GigabitEthernet0/0/1]intg0/0/2[SW-GigabitEthernet0/0/2]portlink-typeaccess[SW-GigabitEthernet0/0/2]portdefaultvlan4三、防火墙配置system-viewEntersystemview,returnuserviewwithCtrl+Z.[SRG][SRG]sysnameHWFW[HWFW]intg0/0/0[HWFW-GigabitEthernet0/0/0]aliasTrust===配置接口描述[HWFW-GigabitEthernet0/0/0]ipadd192.168.1.1024[HWFW]intg0/0/1.2[HWFW-GigabitEthernet0/0/1.2]vlan-typedot1q2====封装VLAN[HWFW-GigabitEthernet0/0/1.2]aliasUntrust[HWFW-GigabitEthernet0/0/1.2]ipadd202.100.1.1024[HWFW-GigabitEthernet0/0/1.2]interfaceGigabitEthernet0/0/1.4[HWFW-GigabitEthernet0/0/1.4]aliasDMZ[HWFW-GigabitEthernet0/0/1.4]vlan-typedot1q4[HWFW-GigabitEthernet0/0/1.4]ipadd172.16.1.1024测试:[HWFW]ping-c2192.168.1.119:26:332014/05/26PING192.168.1.1:56databytes,pressCTRL_CtobreakReplyfrom192.168.1.1:bytes=56Sequence=1ttl=255time=80msReplyfrom192.168.1.1:bytes=56Sequence=2ttl=255time=580ms[HWFW]ping-c2202.100.1.119:26:552014/05/26PING202.100.1.1:56databytes,pressCTRL_CtobreakRequesttimeoutRequesttimeout[HWFW]ping-c2172.16.1.119:27:142014/05/26PING172.16.1.1:56databytes,pressCTRL_CtobreakRequesttimeoutRequesttimeout为什么直连不通?因为默认不同zone之间流量是不允许访问的,可以通过以下命令查看:[HWFW]displaycurrent-configurationfirewallzonetrustsetpriority85addinterfaceGigabitEthernet0/0/0为了测试,可以将防火墙其它两个两口放入相同的zone[HWFW]firewallzonetrust[HWFW-zone-trust]addinterfaceg0/0/1.2[HWFW-zone-trust]addinterfaceGigabitEthernet0/0/1.4[HWFW]ping-c2202.100.1.119:32:392014/05/26PING202.100.1.1:56databytes,pressCTRL_CtobreakReplyfrom202.100.1.1:bytes=56Sequence=1ttl=255time=70msReplyfrom202.100.1.1:bytes=56Sequence=2ttl=255time=700ms---202.100.1.1pingstatistics---2packet(s)transmitted2packet(s)received0.00%packetlossround-tripmin/avg/max=70/385/700ms[HWFW]ping-c2172.16.1.119:32:452014/05/26PING172.16.1.1:56databytes,pressCTRL_CtobreakReplyfrom172.16.1.1:bytes=56Sequence=1ttl=255time=70msReplyfrom172.16.1.1:bytes=56Sequence=2ttl=255time=560ms---172.16.1.1pingstatistics---2packet(s)transmitted2packet(s)received0.00%packetlossround-tripmin/avg/max=70/315/560mssave===保存配置19:37:092014/05/26Thecurrentconfigurationwillbewrittentothedevice.Areyousuretocontinue?[Y/N]y2014-05-2619:37:11HWFW�M/4/SAVE(l):Whendecidingwhethertosaveconfigurationtothedevice,theuserchoseY.Doyouwanttosynchronicallysavetheconfigurationtothestartupsaved-configurationfileonpeerdevice?[Y/N]:yNowsavingthecurrentconfigurationtothedevice..Info:Thecurrentconfigurationwassavedtothedevicesuccessfully.resetsaved-configuration?resetsaved-configuration====清空配置19:37:262014/05/26Theactionwilldeletethesavedconfigurationinthedevice.Theconfigurationwillbeerasedtoreconfigure.Areyousure?[Y/N]yNowclearingtheconfigurationinthedevice.2014-05-2619:37:28HWFW�M/4/RST_CFG(l):Whendecidingwhethertoresetthesavedconfiguration,theuserchoseY.Error:Theconfigfiledoesnotexist!LAB2:三接口初始化一、基本配置[SW]vlanbatch2to4interfaceGigabitEthernet0/0/1portlink-typeaccessportdefaultvlan2interfaceGigabitEthernet0/0/8portlink-typeaccessportdefaultvlan2interfaceGigabitEthernet0/0/3portlink-typeaccessportdefaultvlan3interfaceGigabitEthernet0/0/10portlink-typeaccessportdefaultvlan3interfaceGigabitEthernet0/0/2portlink-typeaccessportdefaultvlan4interfaceGigabitEthernet0/0/9portlink-typeaccessportdefaultvlan4二、防火墙配置[HWFW]undointerfaceg0/0/1.2===删除子接口[HWFW]undointerfaceg0/0/1.4interfaceGigabitEthernet0/0/0ipaddress202.100.1.10255.255.255.0interfaceGigabitEthernet0/0/1ipaddress172.16.1.10255.255.255.0interfaceGigabitEthernet0/0/2ipaddress192.168.1.10255.255.255.0测试:[HWFW]ping-c1202.100.1.120:01:232014/05/26PING202.100.1.1:56databytes,pressCTRL_CtobreakReplyfrom202.100.1.1:bytes=56Sequence=1ttl=255time=950ms[HWFW]ping-c1172.16.1.120:01:592014/05/26PING172.16.1.1:56databytes,pressCTRL_CtobreakReplyfrom172.16.1.1:bytes=56Sequence=1ttl=255time=180ms[HWFW]ping-c1192.168.1.120:02:272014/05/26PING192.168.1.1:56databytes,pressCTRL_CtobreakReplyfrom192.168.1.1:bytes=56Sequence=1ttl=255time=780ms安全区域概述:安全区域(SecurityZone),或者简称为区域(Zone),是一个安全概念,大部分的安全策略都基于安全区域实施。在防火墙中引入“安全区域”的概念是为了对流量来源进行安全等级的划分,以判断何时对流量进行检测。通常情况下,相同安全区域中的流量流动是不需要检测的,而不同安全区域的流量由于存在安全风险,是需要受到防火墙控制的。一个安全区域是一个或多个接口的集合,这些网络中的用户具有相同的安全属性。每个安全区域具有全局唯一的安全优先级,安全级别的范围是1-100,数字越大表示安全级别越高,也就是说受保护的程度越高。防火墙默认安全区域:Untrust(非受信任区域):安全级别为5,通常用于定义互联网流量。DMZ(非军事化区域):安全级别50,通常用于定义内网服务器所在区域。因为这些设备虽然部署在内网,但经常要被公网访问,存在较大安全隐患,同时一般又不允许其主动访问外网,所以部署安全级别比Trust低,但比Untrust高。Trust(受信任区域):安全级别85,通常用于定义内网所在区域。Local(本地区域):安全级别100,该区域主要定义,设备自身发启的流量,或者是抵达设备自身流量。比如Telnet、SNMP、NTP、IPsecVPN等流量。用户不能改变Local区域本身的任何配置,包括添