#yyds干货盘点#HCIE-Security Day17:防火墙双机热备实验(五):防火墙旁挂交换机,交换机静态路由引流

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6


#yyds干货盘点#HCIE-Security Day17:防火墙双机热备实验(五):防火墙旁挂交换机,交换机静态路由引流_防火墙#yyds干货盘点#HCIE-Security Day17:防火墙双机热备实验(五):防火墙旁挂交换机,交换机静态路由引流_认证_02#yyds干货盘点#HCIE-Security Day17:防火墙双机热备实验(五):防火墙旁挂交换机,交换机静态路由引流_防火墙_03

双机热备比较常见的是旁挂部署在数据中心核心交换机上,且两台防火墙之间形成双机热备。

旁挂组网的优点

1、可以在不改变现有网络物理拓扑的情况下,将防火墙部署到网络中。

2、可以有选择低将通过核心交换机的流量引导到防火墙上,即对需要进行安全检测的流量引导到防火墙上进行处理,对不需要进行安全检测的流量直接通过交换机转发。

将流量由交换机引导到旁挂的防火墙上主要由两种常见方式:静态路由方式和策略路由方式,这一节就是通过实验验证静态路由方式。

一般核心交换机与上行路由器和下行汇聚交换机之间运行ospf,由于ospf的路由优先级高于静态路由,所以流量到达核心交换机后会根据ospf路由直接被转发到上行或者下行的设备,而不会根据静态路由被引流到防火墙上。

所以必须在核心交换机上配置vrf功能,将一台交换机虚拟成连接上行的交换机public和连接下行的交换机vrf。将两个交换机完全隔离出来,流量就会根据静态路由被送到防火墙上。


实验五:防火墙旁挂交换机,交换机静态路由引流

这个实验是比较综合的,主要的难点其实在核心交换机的配置上面,以及汇聚层stp和vrrp的配合。防火墙部分其实是比较简单的,无非是配置了两条上下行的静态路由,以及配置了vrrp和hrp。

需求和拓扑

 两台FW旁挂在数据中心的核心交换机侧,保证数据中心网络安全。通过核心交换机的流量都会被引流到旁挂的FW上进行安全检测,引流的方式为静态路由方式。企业希望两台FW以主备备份方式工作。正常情况下,流量通过FW_A转发。当FW_A出现故障时,流量通过FW_B转发,保证业务不中断。


 #yyds干货盘点#HCIE-Security Day17:防火墙双机热备实验(五):防火墙旁挂交换机,交换机静态路由引流_安全_04#yyds干货盘点#HCIE-Security Day17:防火墙双机热备实验(五):防火墙旁挂交换机,交换机静态路由引流_安全_05​ 

分析

如果希望通过静态路由方式将经过核心交换机的流量引导到FW,则需要在核心交换机上配置静态路由,下一跳为防火墙接口的地址。但是由于核心交换机与上行路由器和下行汇聚交换机之间运行OSPF,因此流量到达核心交换机后会直接被转发到上行或下行设备,而不会被引流到FW上。

所以如果希望通过静态路由引流,就必须在核心交换机上配置VRF功能,将一台交换机虚拟成连接上行的交换机(根交换机Public)和连接下行的交换机(虚拟交换机VRF)。由于虚拟出的两个交换机完全隔离开来,流量就会被送到FW上。即虚拟出的交换机分别和上行路由器之间运行ospf,和下行汇聚交换机之间运行ospf,但是交换机--防火墙--交换机之间运行静态路由。那么就需要在防火墙和一份为二的交换机各自配置vrrp备份组,使得它们可以通过vrrp备份组的虚拟地址进行通信。在FW上需要配置静态路由,下一跳分别为VRRP备份组3和VRRP备份组4的地址。在Public上配置静态路由,下一跳为VRRP备份组2的地址。在VRF上配置静态路由,下一跳为VRRP备份组1的地址。

对拓扑进行抽象

 #yyds干货盘点#HCIE-Security Day17:防火墙双机热备实验(五):防火墙旁挂交换机,交换机静态路由引流_安全_06​ #yyds干货盘点#HCIE-Security Day17:防火墙双机热备实验(五):防火墙旁挂交换机,交换机静态路由引流_华为_07

操作步骤

1、公网部分

1.1 接口地址配置

//r1r2
[r1]dis cu interface
interface GigabitEthernet0/0/0
ip address 12.1.1.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 1.1.1.1 255.255.255.0
interface LoopBack0
ip address 11.11.11.11 255.255.255.255
<r2>dis cu interface
interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.0
interface GigabitEthernet0/0/1
ip address 2.1.1.1 255.255.255.0
interface LoopBack0
ip address 22.22.22.22 255.255.255.255

1.2 动态路由配置

<r1>dis cu con ospf
[V200R003C00]
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 11.11.11.11 0.0.0.0
network 12.1.1.1 0.0.0.0
//r2

2、防火墙部分

2.1 接口地址和安全区域配置

//
<f1>dis cu inter
interface GigabitEthernet1/0/0
ip address 10.0.0.1 255.255.255.0
interface GigabitEthernet1/0/1
ip address 10.1.0.1 255.255.255.0
interface GigabitEthernet1/0/6
ip address 10.10.0.1 255.255.255.0
//
dis cu con zone
firewall zone trust
add interface GigabitEthernet0/0/0
add interface GigabitEthernet1/0/0
firewall zone untrust
add interface GigabitEthernet1/0/1
firewall zone dmz
add interface GigabitEthernet1/0/6
//f2

2.2 静态路由配置

//f1
<f1>dis cu | in ip rou
2022-02-19 12:57:48.310
ip route-static 0.0.0.0 0.0.0.0 10.1.0.6
ip route-static 192.168.0.0 255.255.0.0 10.0.0.6
//f2

2.3、双机热备配置

2.3.1 配置vrrp备份组
interface GigabitEthernet1/0/0
vrrp vrid 1 virtual-ip 10.0.0.3 active
interface GigabitEthernet1/0/1
vrrp vrid 2 virtual-ip 10.1.0.3 active
2.3.2 配置hrp检测
hrp interface GigabitEthernet1/0/6 remote 10.10.0.2
2.3.3 启动双机热备
hrp

2.4、配置安全策略

security-policy
rule name 1
source-zone trust
source-zone untrust
destination-zone trust
destination-zone untrust
action permit

3、核心交换部分

3.1 虚拟交换机配置

//vrf
<s1>dis cu configuration vpn-instance
ip vpn-instance vrf
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
//
interface Vlanif1
ip binding vpn-instance vrf
interface Vlanif2
ip binding vpn-instance vrf
//s2

3.2 vlan接口配置

vlan batch 2 3 5 
interface Vlanif1
ip address 10.2.0.1 255.255.255.0
interface Vlanif2
ip address 10.0.0.4 255.255.255.0

interface Vlanif3
ip address 10.1.0.4 255.255.255.0

interface Vlanif5
ip address 1.1.1.2 255.255.255.0

//s2

3.3 物理接口划分

interface GigabitEthernet0/0/1
port link-type access
port default vlan 5
interface GigabitEthernet0/0/2
port link-type access
port default vlan 2
interface GigabitEthernet0/0/3
port link-type access
port default vlan 3
interface GigabitEthernet0/0/4
port link-type access
interface GigabitEthernet0/0/5
port link-type access
interface GigabitEthernet0/0/6
port link-type trunk
port trunk allow-pass vlan 2
interface GigabitEthernet0/0/7
port link-type trunk
port trunk allow-pass vlan 3

3.4 路由配置

//
<s1>dis cu | in ip rou
ip route-static 192.168.0.0 255.255.0.0 10.1.0.3
ip route-static vpn-instance vrf 11.11.11.11 255.255.255.255 10.0.0.3
ip route-static vpn-instance vrf 22.22.22.22 255.255.255.255 10.0.0.3
//ospf
<s1>dis cu configuration ospf
ospf 1 router-id 1.1.1.3
import-route static
area 0.0.0.0
network 1.1.1.2 0.0.0.0
ospf 2 router-id 1.1.2.1 vpn-instance vrf
import-route static
area 0.0.0.0
network 10.2.0.1 0.0.0.0
//s2

3.5 vrrp配置

interface Vlanif2
vrrp vrid 3 virtual-ip 10.0.0.6
vrrp vrid 3 priority 120
interface Vlanif3
vrrp vrid 4 virtual-ip 10.1.0.6
vrrp vrid 4 priority 120

4、汇聚交换部分

4.1 vlan接口配置

//s33vlanif1s1vlanif2192.168.1.0/24
//vlanif3192.168.2.0/24vlanif2vlanif3
//vrrpmstp
vlan batch 1 2 3
interface Vlanif1
ip address 10.2.0.3 255.255.255.0
interface Vlanif2
ip address 192.168.1.254 255.255.255.0

interface Vlanif3
ip address 192.168.2.254 255.255.255.0


//s4

4.2 物理接口划分

interface GigabitEthernet0/0/1
port link-type access
interface GigabitEthernet0/0/2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 2 to 3
interface GigabitEthernet0/0/3
port link-type access
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 3
interface GigabitEthernet0/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 3
interface GigabitEthernet0/0/6
port link-type trunk
port trunk allow-pass vlan 2 to 3
interface GigabitEthernet0/0/7
port link-type trunk
port trunk allow-pass vlan 2 to 3

4.3 mstp配置

//mstp
<s3>dis cu configuration mst-region
stp region-configuration
region-name huawei
revision-level 12
instance 10 vlan 2
instance 20 vlan 3
active region-configuration
stp instance 10 root primary
stp instance 20 root secondary
//s4

4.4 vrrp配置

interface Vlanif2
ip address 192.168.1.254 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.252
vrrp vrid 1 priority 120
interface Vlanif3
ip address 192.168.2.254 255.255.255.0
vrrp vrid 2 virtual-ip 192.168.2.252

4.5 路由配置

ospf 2 router-id 1.1.2.3
area 0.0.0.0
network 10.2.0.3 0.0.0.0
network 192.168.0.0 0.0.255.255
//s4

5、接入交换部分

interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface Ethernet0/0/1
port link-type access
port default vlan 2


验证和分析

1、检查路由情况

<r1>dis ip routing-table | inc 192.168
Route Flags: R - relay, D - download to fib
Destination/Mask Proto Pre Cost Flags NextHop Interface

192.168.0.0/16 O_ASE 150 1 D 1.1.1.2 GigabitEthernet0/0/1


[s3]dis ip routing-table | inc 11.11.11.11
Route Flags: R - relay, D - download to fib
Destination/Mask Proto Pre Cost Flags NextHop Interface

11.11.11.11/32 O_ASE 150 1 D 10.2.0.2 Vlanif1

2、检查vrrp备份组情况

HRP_M<f1>dis vrrp
2022-02-19 13:09:05.960
GigabitEthernet1/0/0 | Virtual Router 1
State : Master
Virtual IP : 10.0.0.3
Master IP : 10.0.0.1
PriorityRun : 120
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 60 s
TimerConfig : 60 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : vgmp-vrrp
Backup-forward : disabled
Create time : 2022-02-19 10:34:43
Last change time : 2022-02-19 10:34:46

GigabitEthernet1/0/1 | Virtual Router 2
State : Master
Virtual IP : 10.1.0.3
Master IP : 10.1.0.1
PriorityRun : 120
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 60 s
TimerConfig : 60 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : vgmp-vrrp
Backup-forward : disabled
Create time : 2022-02-19 10:34:43
Last change time : 2022-02-19 10:34:46

3、检查双机热备情况

HRP_M<f1>dis hrp state verbose
2022-02-19 13:09:33.120
Role: active, peer: standby
Running priority: 45000, peer: 45000
Detail information:
GigabitEthernet1/0/0 vrrp vrid 1: active
GigabitEthernet1/0/1 vrrp vrid 2: active
ospf-cost: +0
ospfv3-cost: +0
bgp-cost: +0
HRP_S<f2>dis hrp state verbose
2022-02-19 13:10:35.010
Role: standby, peer: active
Running priority: 45000, peer: 45000
Detail information:
GigabitEthernet1/0/0 vrrp vrid 1: standby
GigabitEthernet1/0/1 vrrp vrid 2: standby
ospf-cost: +65500
ospfv3-cost: +65500
bgp-cost: +100


阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

“#yyds干货盘点#HCIE-Security Day17:防火墙双机热备实验(五):防火墙旁挂交换机,交换机静态路由引流” 的相关文章