防火墙旁挂部署+故障切换

一、实验环境

华为ENSP

二、拓扑

三、目的

1、内网PC1访问Server

2、防火墙旁挂部署,对流量进行过滤,防火墙挂掉之后,内网PC1能继续访问到Server

3、防火墙恢复正常后,流量能回切至防火墙转发

四、思路:

1、AR1配置策略路由,下一跳指向防火墙的172.16.1.2,联动NQA,持续探测172.16.1.2

2、同时配置一条默认路由指向223.5.5.5 策略路由应用在AR1的G4/0/0接口inbound方向(备用线路)

反向的策略路由同理

3、防火墙只需配置好IP地址,加入安全区域,写一条默认路由指向172.16.1.5(这里忽略掉防火墙策略路由哈,可以全放)

五、配置文件

复制代码
AR1配置文件

nqa test-instance 3000 1 
 test-type icmp
 destination-address ipv4 172.16.1.2
 frequency 10
 interval seconds 3
 timeout 2
 probe-count 2
 start now
nqa test-instance 3001 1 
 test-type icmp
 destination-address ipv4 172.16.1.6
 frequency 10
 interval seconds 3
 timeout 2
 probe-count 2
 start now

interface GigabitEthernet0/0/0
 ip address 223.5.5.6 255.255.255.0 
 traffic-policy 3001 inbound
#
interface GigabitEthernet0/0/1
 ip address 172.16.1.5 255.255.255.252 
#
interface GigabitEthernet0/0/2
 ip address 172.16.1.1 255.255.255.252 
#
interface GigabitEthernet4/0/0
 ip address 192.168.0.254 255.255.255.0 
 traffic-policy 3000 inbound

acl number 3000  
 rule 5 permit ip source 192.168.0.0 0.0.0.255 
acl number 3001  
 rule 5 permit ip destination 192.168.0.0 0.0.0.255 
#
traffic classifier 3001 operator or
 if-match acl 3001
traffic classifier 3000 operator or
 if-match acl 3000
#
traffic behavior 3001
 redirect ip-nexthop 172.16.1.6 track nqa 3001 1
traffic behavior 3000
 redirect ip-nexthop 172.16.1.2 track nqa 3000 1
#
traffic policy 3001
 classifier 3001 behavior 3001
traffic policy 3000
 classifier 3000 behavior 3000

ip route-static 0.0.0.0 0.0.0.0 223.5.5.5

SW1无配置

PC1

Server

六、效果

此时可以看出流量已经过了防火墙

这里我防火墙创建一条策略方便查看流量

此时持续ping,同时关闭防火墙,发现丢了几个包,后面又通了

此时检查一下路径发现已经切换,之后从AR1的G0/0/0接口出去

此时再持续ping 把防火墙打开

发现丢了两个包之后,流量已完成回切,此处实验已完成

七、NQA部分命令注释(仅供参考,具体以实际网络环境为准)

复制代码
nqa test-instance 3000 1    #创建1个实例
 test-type icmp           #探测类型icmp
 destination-address ipv4 172.16.1.2         #探测地址172.16.1.2
 frequency 10               #每10秒探测一次
 interval seconds 3        #每个icmp包的间隔3秒
 timeout 2                 #超时时间 2秒
 probe-count 2             #每次探测发送2个icmp包
 start now                 #现在开启探测

查看探测结果

重点关注探测结果和丢包率

此处显示探测成功、丢包率0%(正常)

相关推荐
cv高级工程师YKY几秒前
SRE - - PV、UV、VV、IP详解及区别
大数据·服务器·uv
秦歌6667 分钟前
向量数据库-Milvus快速入门
数据库·milvus
眠修30 分钟前
Kuberrnetes 服务发布
linux·运维·服务器
GalaxyPokemon1 小时前
RPC-Client模块
网络·网络协议·rpc
Edingbrugh.南空1 小时前
Flink SQLServer CDC 环境配置与验证
数据库·sqlserver·flink
码不停蹄的玄黓2 小时前
MySQL分布式ID冲突详解:场景、原因与解决方案
数据库·分布式·mysql·id冲突
chirrupy_hamal2 小时前
如何避免 SYN 攻击?
网络·tcp
BAOYUCompany2 小时前
暴雨服务器成功中标华中科技大学集成电路学院服务器采购项目
运维·服务器
爱上语文2 小时前
Redis基础(6):SpringDataRedis
数据库·redis·后端
怦然星动_2 小时前
ip网络基础
网络·智能路由器