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

一、实验环境

华为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%(正常)

相关推荐
wanhengidc2 分钟前
什么是云手机?
运维·网络·安全·游戏·智能手机
柠檬汁Dev10 分钟前
还在等DBA给你库?我3分钟就拉起一个高可用集群
数据库·云计算·dba
optiz14 分钟前
细菌基因组genome二代测序数据分析
linux·运维·服务器
安卓开发者17 分钟前
鸿蒙NEXT应用数据持久化全面解析:从用户首选项到分布式数据库
数据库·分布式·harmonyos
机器人梦想家20 分钟前
pymodbus启动一个简单的modbus tcp server
网络·网络协议·tcp/ip
一刀到底21128 分钟前
springboot3.3.5 集成elasticsearch8.12.2 ssl 通过 SSL bundle name 来实现
网络·elasticsearch·ssl·springboot3
m0_6613162334 分钟前
modbus_tcp和modbus_rtu对比&移植AT-socket,modbus_tcp&杂记
服务器·网络·tcp/ip
IT成长日记1 小时前
【Linux基础】Linux系统管理:GPT分区实践详细操作指南
linux·运维·服务器·gpt·parted·磁盘分区·fdisk
少男的脸红藏不住心事1 小时前
GD32入门到实战35--485实现OTA
数据库·mongodb·nosql
eqwaak01 小时前
Matplotlib 动态显示详解:技术深度与创新思考
网络·python·网络协议·tcp/ip·语言模型·matplotlib