第一部分华为防火墙基本初始化LAB1 子接口初始化一、实验拓扑二、基本配置SW:[SW]vlan 2[SW-vlan2]description Untrust[SW-vlan2]vlan 3[SW-vlan3]description Trust[SW-vlan3]vlan 4[SW-vlan4]description DMZ[SW]int g0/0/9[SW-GigabitEthernet0/0/8]port link-type access[SW-GigabitEthernet0/0/8]port default vlan 3[SW-GigabitEthernet0/0/8]int g0/0/3[SW-GigabitEthernet0/0/3]port link-type access[SW-GigabitEthernet0/0/3]port default vlan 3[SW]int g0/0/9[SW-GigabitEthernet0/0/9]port link-type trunk[SW-GigabitEthernet0/0/9]port trunk allow-pass vlan 1 2 4 [SW]int g0/0/1[SW-GigabitEthernet0/0/1]port link-type access [SW-GigabitEthernet0/0/1]port default vlan 2[SW-GigabitEthernet0/0/1]int g0/0/2[SW-GigabitEthernet0/0/2]port link-type access[SW-GigabitEthernet0/0/2]port default vlan 4三、防火墙配置system-viewEnter system view, return user view with Ctrl+Z.[SRG][SRG]sysname HWFW[HWFW]int g0/0/0[HWFW-GigabitEthernet0/0/0]alias Trust ===配置接口描述[HWFW-GigabitEthernet0/0/0]ip add 192.168.1.10 24 [HWFW]int g0/0/1.2[HWFW-GigabitEthernet0/0/1.2]vlan-type dot1q 2 ====封装VLAN [HWFW-GigabitEthernet0/0/1.2]alias Untrust[HWFW-GigabitEthernet0/0/1.2]ip add 202.100.1.10 24[HWFW-GigabitEthernet0/0/1.2]interface GigabitEthernet0/0/1.4 [HWFW-GigabitEthernet0/0/1.4]alias DMZ[HWFW-GigabitEthernet0/0/1.4]vlan-type dot1q 4[HWFW-GigabitEthernet0/0/1.4]ip add 172.16.1.10 24测试:[HWFW]ping -c 2 192.168.1.119:26:33 2014/05/26PING 192.168.1.1: 56 data bytes, press CTRL_C to breakReply from 192.168.1.1: bytes=56 Sequence=1 ttl=255 time=80 msReply from 192.168.1.1: bytes=56 Sequence=2 ttl=255 time=580 ms [HWFW]ping -c 2 202.100.1.119:26:55 2014/05/26PING 202.100.1.1: 56 data bytes, press CTRL_C to breakRequest time outRequest time out[HWFW]ping -c 2 172.16.1.119:27:14 2014/05/26PING 172.16.1.1: 56 data bytes, press CTRL_C to breakRequest time outRequest time out为什么直连不通?因为默认不同zone之间流量是不允许访问的,可以通过以下命令查看:[HWFW]display current-configurationfirewall zone trustset priority 85add interface GigabitEthernet0/0/0为了测试,可以将防火墙其它两个两口放入相同的zone[HWFW] firewall zone trust[HWFW-zone-trust]add interface g0/0/1.2[HWFW-zone-trust]add interface GigabitEthernet0/0/1.4[HWFW]ping -c 2 202.100.1.119:32:39 2014/05/26PING 202.100.1.1: 56 data bytes, press CTRL_C to breakReply from 202.100.1.1: bytes=56 Sequence=1 ttl=255 time=70 ms Reply from 202.100.1.1: bytes=56 Sequence=2 ttl=255 time=700 ms --- 202.100.1.1 ping statistics ---2 packet(s) transmitted2 packet(s) received0.00% packet lossround-trip min/avg/max = 70/385/700 ms[HWFW]ping -c 2 172.16.1.119:32:45 2014/05/26PING 172.16.1.1: 56 data bytes, press CTRL_C to breakReply from 172.16.1.1: bytes=56 Sequence=1 ttl=255 time=70 ms Reply from 172.16.1.1: bytes=56 Sequence=2 ttl=255 time=560 ms --- 172.16.1.1 ping statistics ---2 packet(s) transmitted2 packet(s) received0.00% packet lossround-trip min/avg/max = 70/315/560 mssave ===保存配置19:37:09 2014/05/26The current configuration will be written to the device.Are you sure to continue?[Y/N]y2014-05-26 19:37:11 HWFW �M/4/SAVE(l): When deciding whether to save configuration to the device, the user chose Y.Do you want to synchronically save the configuration to the startupsaved-configuration file on peer device?[Y/N]:yNow saving the current configuration to the device..Info:The current configuration was saved to the device successfully.reset saved-configuration ?reset saved-configuration ====清空配置19:37:26 2014/05/26The action will delete the saved configuration in thedevice.The configuration will be erased to reconfigure.Are you sure?[Y/N]yNow clearing the configuration in the device.2014-05-26 19:37:28 HWFW �M/4/RST_CFG(l): When deciding whether to reset the saved configuration, the user chose Y.Error:The config file does not exist!LAB2:三接口初始化一、基本配置[SW]vlan batch 2 to 4port link-type accessport default vlan 2interface GigabitEthernet0/0/8port link-type accessport default vlan 2interface GigabitEthernet0/0/3port link-type accessport default vlan 3interface GigabitEthernet0/0/10port link-type accessport default vlan 3interface GigabitEthernet0/0/2port link-type accessport default vlan 4interface GigabitEthernet0/0/9port link-type accessport default vlan 4二、防火墙配置[HWFW]undo interface g0/0/1.2 ===删除子接口[HWFW]undo interface g0/0/1.4ip address 202.100.1.10 255.255.255.0interface GigabitEthernet0/0/1ip address 172.16.1.10 255.255.255.0interface GigabitEthernet0/0/2ip address 192.168.1.10 255.255.255.0测试:[HWFW]ping -c 1 202.100.1.120:01:23 2014/05/26PING 202.100.1.1: 56 data bytes, press CTRL_C to breakReply from 202.100.1.1: bytes=56 Sequence=1 ttl=255 time=950 ms [HWFW]ping -c 1 172.16.1.120:01:59 2014/05/26PING 172.16.1.1: 56 data bytes, press CTRL_C to breakReply from 172.16.1.1: bytes=56 Sequence=1 ttl=255 time=180 ms [HWFW]ping -c 1 192.168.1.120:02:27 2014/05/26PING 192.168.1.1: 56 data bytes, press CTRL_C to breakReply from 192.168.1.1: bytes=56 Sequence=1 ttl=255 time=780 ms安全区域概述:安全区域(Security Zone),或者简称为区域(Zone),是一个安全概念,大部分的安全策略都基于安全区域实施。