华为防火墙

usg 2000 5000 6300
usg 6600 下一代防火墙
usg 9500

防火墙系列

包过滤防火墙:基于三层、四层过滤
下一代防火墙:基于应用、用户、内容、时间、威胁、位置
最佳使用原则:基于应用+白名单控制+最小授权

防火墙的工作模式

路由模式:接口直接配置ip地址,默认模式
透明模式:接口不能配置ip,作为交换机存在于现有网络
混合模式:一般用于双机热备

华为防火墙的安全区域划分

trust: 连内网,优先级85
dmz:非军事化区,发布服务器到外部,优先级50
untrust:连外网,优先级5
local:防火墙本身,优先级100
其他区域:用户自定义,最多可创建16个,无默认优先级

防火墙流量处理

传统防火墙默认高优先级可以访问低优先级区域
新一代防火墙,默认拒绝所有流量,即使高优先级访问低优先级也要配置策略
相同优先级区域不允许访问

inbound和outbound

inbound:低优先级区域访问高优先级区域
outbound:高优先级访问低优先级区域

状态化信息

五元组:源ip 目标ip 协议 源端口 目标端口
查看会话表:dis firewall session table

安全策略

保护特定网络不受非法者攻击,放行合法流量。
任何两个安全区域的优先级不能相同;
本区域不同接口间的流量不进行过滤
接口没有加入区域不能转发数据
usg6000系列默认无安全策略

AAA认证

Authentication验证、Authorization授权、Accounting统计,处理用户访问请求的服务器程序,
为有权限访问的用户提供服务。
验证:哪些用户可以访问
授权:验证后的用户拥有哪些权限
统计:审计用户都访问了哪些资源

华为防火墙的管理方式

console:本地管理,一般用于初始配置
telnet:一般仅用于内网管理防火墙
web:基于图形化,适合新手,不安全占资源
ssh: 配置复杂,安全性高,适合内外网访问管理防火墙

练习

SpringSecurity防火墙的白名单是如何实现的 防火墙白名单模式_优先级

打开防火墙

右击防火墙------>导入设备配置------>找到E:\eNSP路径下的USG6000V.zip文件------>导入即可

右击防火墙------>启动------>导入设备包------>找到E:\eNSP路径下的vfw_usg.vdi文件------>导入------>再次右击启动即可

打开防火强第一步设置密码,最好复杂点,这里我的密码为20010418skx

telnet访问防火墙

配置防火墙的ip地址

[USG]int g0/0/0
[USG-GigabitEthernet0/0/0]ip add 192.168.1.30 24
[USG-GigabitEthernet0/0/0]quit

打开防火墙的Telnet功能

[USG]telnet server enable

配置防火墙允许远程管理

[USG]int g0/0/0
[USG-GigabitEthernet0/0/0]service-manage enable
[USG-GigabitEthernet0/0/0]service-manage telnet permit
[USG-GigabitEthernet0/0/0]quit

将防火墙接口g0/0/0加入安全区域

[USG]firewall zone trust
[USG-zone-trust]add int g0/0/0
[USG-zone-trust]quit

将防火墙配置域间包过滤,以保证网络基本通信正常。

[USG]security-policy 
[USG-policy-security]rule name allow_telnet		//配置规则,其中allow_telnet是规则名
[USG-policy-security-rule-allow_telnet]source-zone trust		//配置条件
[USG-policy-security-rule-allow_telnet]destination-zone local		//配置条件
[USG-policy-security-rule-allow_telnet]action permit		//配置动作
[USG-policy-security-rule-allow_telnet]quit
[USG-policy-security]quit

配置认证模式及本地用户信息

[USG]user-interface vty 0 4
[USG-ui-vty0-4]aut	
[USG-ui-vty0-4]authentication-mode aaa
[USG-ui-vty0-4]protocol inbound telnet		//允许telnet连接虚拟终端
[USG-ui-vty0-4]quit
[USG]aaa
[USG-aaa]manager-user demo		//配置本地用户demo
[USG-aaa-manager-user-demo]password cipher demo@1234		//配置密码
[USG-aaa-manager-user-demo]service-type telnet		//配置服务类型
[USG-aaa-manager-user-demo]level 3		//配置用户权限级别
[USG-aaa-manager-user-demo]quit

web方式管理防火墙

[USG]int g0/0/0
[USG-GigabitEthernet0/0/0]ip add 192.168.1.30 24
[USG-GigabitEthernet0/0/0]quit
[USG]int g0/0/0	
[USG-GigabitEthernet0/0/0]service-manage http permit		//打开接口的http管理
[USG-GigabitEthernet0/0/0]service-manage https permit		//打开接口的https管理
[USG-GigabitEthernet0/0/0]quit
[USG]firewall zone trust 
[USG-zone-trust]add int g0/0/0
[USG-zone-trust]quit
[USG]security-policy 
[USG-policy-security]rule name allow_web
[USG-policy-security-rule-allow_web]source-zone trust		//接口加入Trust区域
[USG-policy-security-rule-allow_web]destination-zone local
[USG-policy-security-rule-allow_web]action permit
[USG-policy-security-rule-allow_web]quit
[USG-policy-security]quit
[USG]web-manager security enable		//开启https功能
[USG]aaa		//配置aaa以及本地用户
[USG-aaa]manager-user demo
[USG-aaa-manager-user-demo]password 
Enter Password:1234.com	
Confirm Password:1234.com 
[USG-aaa-manager-user-demo]service-type web		//指定用户类型
[USG-aaa-manager-user-demo]level 3		//指定权限级别
[USG-aaa-manager-user-demo]quit
[USG-aaa]quit

ssh方式管理防火墙

[USG]int g0/0/0
[USG-GigabitEthernet0/0/0]ip add 192.168.1.30 24
[USG-GigabitEthernet0/0/0]service-manage enable
[USG-GigabitEthernet0/0/0]service-manage ssh permit
[USG-GigabitEthernet0/0/0]quit
[USG]firewall zone trust
[USG-zone-trust]add int g0/0/0
[USG-zone-trust]quit
[USG]security-policy 
[USG-policy-security]rule name allow_ssh
[USG-policy-security-rule-allow_ssh]source-zone trust
[USG-policy-security-rule-allow_ssh]destination-zone local
[USG-policy-security-rule-allow_ssh]action permit
[USG-policy-security-rule-allow_ssh]quit
[USG-policy-security]quit
[USG]rsa local-key-pair create  //创建SSH所需的密钥对
[USG]user-interface vty 0 4
[USG-ui-vty0-4]auth	
[USG-ui-vty0-4]authentication-mode aaa
[USG-ui-vty0-4]protocol inbound ssh
[USG-ui-vty0-4]quit
[USG]ssh user test			//指定test为SSH用户
[USG]ssh user test authentication-type  password		//配置认证方式
[USG]ssh user test service-type stelnet		//配置服务类型
[USG]aaa
[USG-aaa]manager-user test		//创建本地用户test
[USG-aaa-manager-user-test]password cipher test@123		//指定密码
[USG-aaa-manager-user-test]service-type ssh
[USG-aaa-manager-user-test]level 3
[USG-aaa-manager-user-test]quit
[USG-aaa]quit
[USG]stelnet server enable		//开启SSH