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

一、实验环境

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

相关推荐
XINGTECODE9 分钟前
海盗王3.0的数据库3合1并库处理方案
数据库·海盗王
正在走向自律12 分钟前
GpuGeek 网络加速:破解 AI 开发中的 “最后一公里” 瓶颈
网络·人工智能·python·机器学习·性能优化·gpugeek
滴滴哒~35 分钟前
实验九视图索引
数据库
xixixin_1 小时前
【Vite】前端开发服务器的配置
服务器·前端·网络
.生产的驴2 小时前
Vue3 加快页面加载速度 使用CDN外部库的加载 提升页面打开速度 服务器分发
运维·服务器·前端·vue.js·分布式·前端框架·vue
程序员JerrySUN2 小时前
Linux 内核核心知识热点题分析:10 个连环打通的难点
linux·运维·服务器
史迪仔01122 小时前
Python生成器:高效处理大数据的秘密武器
前端·数据库·python
再睡一夏就好3 小时前
从硬件角度理解“Linux下一切皆文件“,详解用户级缓冲区
linux·服务器·c语言·开发语言·学习笔记
zm4 小时前
TCP 粘包
服务器·网络·php