组网需求 如图4-6所示,某企业在网络边界处部署了设备DeviceA作为安全网关。企业根据员工级别和职能不同划分了三类用户:高层管理者、市场员工、研发员工。三类用户能够访问Internet的权限不同,具体如下表4-6所示。 表4-6 用户与权限关系
高层管理者 10.3.0.2~10.3.0.20 自由访问Internet。
市场员工 10.3.0.21~10.3.0.120 能够访问Internet,但不能使用聊天软件(此例中以QQ为例)。
研发员工 10.3.0.121~10.3.0.220 只能使用TortoiseSVN应用。
图4-6 配置基于应用的安全策略组网图本例中interface1和interface2分别代表10GE0/0/1和10GE0/0/2。
操作步骤
操作步骤
配置接口IP地址和安全区域,完成网络基本参数配置。
# 配置10GE0/0/1接口IP地址,将接口加入trust域。
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] interface 10ge 0/0/1
[DeviceA-10GE0/0/1] undo portswitch
[DeviceA-10GE0/0/1] ip address 10.3.0.1 24
[DeviceA-10GE0/0/1] quit
[DeviceA] firewall zone trust
[DeviceA-zone-trust] add interface 10ge 0/0/1
[DeviceA-zone-trust] quit
# 配置10GE0/0/2接口IP地址,将接口加入untrust域。
[DeviceA] interface 10ge 0/0/2
[DeviceA-10GE0/0/2] undo portswitch
[DeviceA-10GE0/0/2] ip address 1.1.1.1 24
[DeviceA-10GE0/0/2] quit
[DeviceA] firewall zone untrust
[DeviceA-zone-untrust] add interface 10ge 0/0/2
[DeviceA-zone-untrust] quit
配置三类用户的地址对象。
# 配置高层管理者的地址对象。
[DeviceA] ip address-set management type object
[DeviceA-object-address-set-management] address range 10.3.0.2 10.3.0.20
[DeviceA-object-address-set-management] quit
# 配置市场员工的地址对象。
[DeviceA] ip address-set marketing type object
[DeviceA-object-address-set-marketing] address range 10.3.0.21 10.3.0.120
[DeviceA-object-address-set-marketing] quit
# 配置研发员工的地址对象。
[DeviceA] ip address-set research type object
[DeviceA-object-address-set-research] address range 10.3.0.121 10.3.0.220
[DeviceA-object-address-set-research] quit
配置高层管理者的安全策略。允许其自由访问Internet。
[DeviceA] security-policy
[DeviceA-policy-security] rule name policy_sec_management
[DeviceA-policy-security-rule-policy_sec_management] source-zone trust
[DeviceA-policy-security-rule-policy_sec_management] destination-zone untrust
[DeviceA-policy-security-rule-policy_sec_management] source-address address-set management
[DeviceA-policy-security-rule-policy_sec_management] action permit
[DeviceA-policy-security-rule-policy_sec_management] quit
配置市场员工的安全策略,禁止使用聊天软件(此例中以QQ为例)。
[DeviceA-policy-security] rule name policy_sec_marketing_1
[DeviceA-policy-security-rule-policy_sec_marketing_1] source-zone trust
[DeviceA-policy-security-rule-policy_sec_marketing_1] destination-zone untrust
[DeviceA-policy-security-rule-policy_sec_marketing_1] source-address address-set marketing
[DeviceA-policy-security-rule-policy_sec_marketing_1] application app QQ_IM
[DeviceA-policy-security-rule-policy_sec_marketing_1] application app QQ_VoIP
[DeviceA-policy-security-rule-policy_sec_marketing_1] action deny
[DeviceA-policy-security-rule-policy_sec_marketing_1] quit
配置研发员工的安全策略。只允许其使用TortoiseSVN应用。
[DeviceA-policy-security] rule name policy_sec_research
[DeviceA-policy-security-rule-policy_sec_research] source-zone trust
[DeviceA-policy-security-rule-policy_sec_research] destination-zone untrust
[DeviceA-policy-security-rule-policy_sec_research] source-address address-set research
[DeviceA-policy-security-rule-policy_sec_research] application app TortoiseSVN
[DeviceA-policy-security-rule-policy_sec_research] action permit
[DeviceA-policy-security-rule-policy_sec_research] quit
研发员工的访问Internet的其他流量会命中缺省安全策略而被阻断。
配置缺省安全策略的动作为禁止。
[DeviceA-policy-security] default action deny
检查配置结果
使用高层管理者网段的PC,尝试是否无限制访问Internet。
使用市场员工网段的PC,尝试是否无法使用QQ聊天,但是可以正常访问其他网络应用。
使用研发员工网段的PC,尝试是否除了TortoiseSVN应用以外都无法访问Internet。
配置脚本
#
sysname DeviceA
#
ip address-set management type object
address 0 range 10.3.0.2 10.3.0.20
#
ip address-set marketing type object
address 0 range 10.3.0.21 10.3.0.120
#
ip address-set research type object
address 0 range 10.3.0.121 10.3.0.220
#
interface 10GE 0/0/1
ip address 10.3.0.1 255.255.255.0
#
interface 10GE 0/0/2
ip address 1.1.1.1 255.255.255.0
#
firewall zone trust
set priority 85
add interface 10GE 0/0/1
#
firewall zone untrust
set priority 5
add interface 10GE 0/0/2
#
security-policy
default action deny
rule name policy_sec_management
source-zone trust
destination-zone untrust
source-address address-set management
action permit
rule name policy_sec_marketing_1
source-zone trust
destination-zone untrust
source-address address-set marketing
application app QQ_IM
application app QQ_VoIP
action deny
rule name policy_sec_marketing_2
source-zone trust
destination-zone untrust
source-address address-set marketing
action permit
rule name policy_sec_research
source-zone trust
destination-zone untrust
source-address address-set research
application app TortoiseSVN
action permit
#
return
|