经验共享:H3C S9500 防火墙板的透明模式和路由模式

  【基本信息】

  S市C局使用两台H3C S9512做为全市C局信息系统网络的核心交换机,两台9512做VRRP,并各配置了一块防火墙单板。

  




  【问题描述】

  此项目以前开局时因各种原因,两台9512上的防火墙单板都没有使用。此次网络优化时,用户重点提出要充分利用两块防火墙板。

  1.首先要把9512_1上的FW_1接在主出口路由器NE40上,做为防火墙使用。

  2.另外需要在9512_2上的FW_2做NAT,做为访问某些公网地址的出口设备。

  【问题解决过程】

  1. H3C S9500 防火墙板的透明模式

  因为9512_1的FW_1是位于9512_1与NE40之间,且FW_1上不需要做任何安全过滤策略,所以考虑把FW_1做为透明模式。要保护的VLAN分别为5(9512与NE40互联VLAN)、19(9512与下属各区互联VLAN)、99(9512与下属各单位互联VLAN)。

  

防火墙透明模式组网图


  配置步骤:

  #划分VLAN。

  [S_SZCGJ_S9512_1]vlan 5

  [S_SZCGJ_S9512_1]vlan 19

  [S_SZCGJ_S9512_1]vlan 99

  # 配置IP地址

  [S_SZCGJ_S9512_1]interface vlan-interface 5

  [S_SZCGJ_S9512_1-Vlan-interface5] ip address 10.30.1.3 255.255.255.248

  [S_SZCGJ_S9512_1]interface vlan-interface 19

  [S_SZCGJ_S9512_1-Vlan-interface19] ip address 10.30.19.2 255.255.255.248

  [S_SZCGJ_S9512_1]interface vlan-interface 99

  [S_SZCGJ_S9512_1-Vlan-interface99] ip address 10.30.99.2 255.255.255.248

  # 配置静态路由

  [S_SZCGJ_S9512_1] ip route-static 0.0.0.0 0.0.0.0 10.30.1.1

  # 配置防火墙板接口聚合(防火墙板槽位号为11)。

  [S_SZCGJ_S9512_1] secblade aggregation slot 11

  # 建立防火墙板配置模块firewall。

  [S_SZCGJ_S9512_1] secblade module firewall

  # 设置需要保护的VLAN。

  [S_SZCGJ_S9512_1-secblade-firewall] security-vlan 5 19 99

  # 映射防火墙板配置模块到指定槽位的防火墙单板。

  [S_SZCGJ_S9512_1-secblade-firewall] map to slot 11

  # 登录到指定槽位的防火墙单板。

  secblade slot 11 (缺省用户名和密码为SecBlade)

  user:SecBlade

  password: SecBlade

  # 设置防火墙板工作在透明模式下。

  [SecBlade_FW_1] firewall mode transparent

  # 创建子接口。

  [SecBlade_FW_1] interface GigabitEthernet 0/0.5

  [SecBlade_FW_1-GigabitEthernet0/0.5] vlan-type dot1q vid 5

  [SecBlade_FW_1] interface GigabitEthernet 0/0.19

  [SecBlade_FW_1-GigabitEthernet0/0.19] vlan-type dot1q vid 19

  [SecBlade_FW_1] interface GigabitEthernet 0/0.99

  [SecBlade_FW_1-GigabitEthernet0/0.99] vlan-type dot1q vid 99

  # 将外网子接口添加到Untrust 区域。

  [SecBlade_FW_1] firewall zone Untrust

  [SecBlade_FW_1-zone-untrust] add interface GigabitEthernet 0/0.5

  [SecBlade_FW_1-zone-untrust] add interface GigabitEthernet 0/0.19

  [SecBlade_FW_1-zone-untrust] add interface GigabitEthernet 0/0.99

  # 打开防火墙包过滤开关

  [SecBlade_FW_1]firewall packet-filter enable

  [SecBlade_FW_1]firewall packet-filter default permit

  # 配置攻击防范

  [SecBlade_FW_1] firewall defend all

  # 配置ASPF

  aspf-policy 1

  detect h323

  detect rtsp

  detect http

  detect smtp

  detect ftp

  detect tcp

  detect udp

  [SecBlade_FW_1-GigabitEthernet0/0.5]firewall aspf 1 outbound

  说明:安全Vlan不能跨FW单板,否则会引起广播风暴

  刚开始用户想对保护VLAN分开接入,把VLAN 5接在FW_1上,VLAN 19、99接在FW_2上。而且考虑到备份问题,两块FW板上都要保护vlan 5、19、99。但这样配置的后果是:从FW_1出来VLAN 5的报文到FW_2,而FW_2又会从Vlan 19或者Vlan 99出来,接着回到FW_1,重复以上循环,形成广播风暴,这是透明模式所决定。此时两台9512响应速度非常缓慢,而且全网瘫痪,PC ping不通网关,无法连上外网。所以经过与用户沟通,把vlan 5、19、99统一接入到FW_1上,不做跨FW单板。

  2. H3C S9500 防火墙板做NAT

  9512_2上的FW_2做NAT,做为访问202.104.124.0/24和218.17.225.0/24这两个C段公网地址的出口设备。因为要做NAT,所以把FW_2设置为路由模式。9512_2与FW_2互联vlan为vlan 6(10.30.1.8/30)。FW_2与出口路由器的互联ip为192.168.23.100/24。

  

防火墙路由模式组网图


  配置步骤:

  #划分VLAN。

  [S_SZCGJ_S9512_2]vlan 6

  # 配置IP地址

  [S_SZCGJ_S9512_2]interface vlan-interface 6

  [S_SZCGJ_S9512_2-Vlan-interface6] ip address 10.30.1.9 255.255.255.252

  # 配置静态路由

  [S_SZCGJ_S9512_2] ip route-static 202.104.124.0 255.255.255.0 10.30.1.10

  [S_SZCGJ_S9512_2] ip route-static 218.17.225.0 255.255.255.0 10.30.1.10

  # 配置防火墙板接口聚合(防火墙板槽位号为11)。

  [S_SZCGJ_S9512_2] secblade aggregation slot 11

  # 建立防火墙板配置模块firewall。

  [S_SZCGJ_S9512_2] secblade module firewall

  # 指定防火墙板接口VLAN

  [S_SZCGJ_S9512_2-secblade-firewall]secblade-interface vlan-interface 6

  # 映射防火墙板配置模块到指定槽位的防火墙单板。

  [S_SZCGJ_S9512_2-secblade-firewall] map to slot 11

  # 登录到指定槽位的防火墙单板。

  secblade slot 11 (缺省用户名和密码为SecBlade)

  user:SecBlade

  password: SecBlade

  # 设置防火墙板工作在路由模式下。

  [SecBlade_FW_2] firewall mode route

  # 打开防火墙包过滤开关

  [SecBlade_FW_2]firewall packet-filter enable

  [SecBlade_FW_2]firewall packet-filter default permit

  # 创建内网子接口。

  [SecBlade_FW_2] interface GigabitEthernet 0/0.6

  [SecBlade_FW_2-GigabitEthernet0/0.6] vlan-type dot1q vid 6

  [SecBlade_FW_2-GigabitEthernet0/0.6] ip address 10.30.1.10 255.255.255.252

  # 配置外网接口。

  [SecBlade_FW_2] interface Ethernet0/2

  [SecBlade_FW_2-Ethernet0/2] ip address 192.168.23.100 255.255.255.0

  # 将内网子接口添加到trust 区域。

  [SecBlade_FW_2] firewall zone trust

  [SecBlade_FW_2-zone-trust] add interface GigabitEthernet 0/0.6

  # 将外网接口添加到untrust 区域。

  [SecBlade_FW_2] firewall zone untrust

  [SecBlade_FW_2-zone-untrust] add interface Ethernet0/2

  # 配置ACL规则

  [SecBlade_FW_2]acl number 3000

  [SecBlade_FW_2-acl-adv-3000] rule 0 permit ip source 192.168.0.0 0.0.255.255

  [SecBlade_FW_2-acl-adv-3000] rule 1 permit ip source 172.16.10.0 0.0.0.255

  # 配置NAT

  [SecBlade_FW_2]interface Ethernet0/2

  [SecBlade_FW_2-Ethernet0/2]nat outbound 3000

  # 配置静态路由

  [SecBlade_FW_2] ip route-static 0.0.0.0 0.0.0.0 192.168.23.254

  [SecBlade_FW_2] ip route-static 172.16.10.0 255.255.255.0 10.30.1.9

  [SecBlade_FW_2] ip route-static 192.168.0.0 255.255.0.0 10.30.1.9


2015年12月