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

一、实验环境

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

相关推荐
wanhengidc16 分钟前
云手机存在的意义是什么
运维·服务器·arm开发·安全·智能手机
洛克大航海2 小时前
解锁 PySpark SQL 的强大功能:有关 App Store 数据的端到端教程
linux·数据库·sql·pyspark sql
FAFU_kyp3 小时前
Spring Boot 邮件发送系统 - 从零到精通教程
java·网络·spring boot
XueminXu3 小时前
ClickHouse数据库的表引擎
数据库·clickhouse·log·表引擎·mergetree·special·integrations
报错小能手3 小时前
计算机网络自顶向下方法25——运输层 TCP流量控制 连接管理 “四次挥手”的优化
服务器·网络·计算机网络
冒泡的肥皂3 小时前
MVCC初学demo(二
数据库·后端·mysql
代码程序猿RIP3 小时前
【Redis 】Redis 详解以及安装教程
数据库·etcd
小生凡一3 小时前
redis 大key、热key优化技巧|空间存储优化|调优技巧(一)
数据库·redis·缓存
oe10193 小时前
好文与笔记分享 A Survey of Context Engineering for Large Language Models(上)
数据库·笔记·语言模型·agent·上下文工程
郭源潮13 小时前
《Muduo网络库:实现TcpServer类终章》
服务器·网络·c++·网络库