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

一、实验环境

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

相关推荐
LUCIAZZZ27 分钟前
简单的SQL语句的快速复习
java·数据库·sql
马立杰1 小时前
H3CNE-33-BGP
运维·网络·h3cne
Mason Lin1 小时前
2025年1月22日(网络编程 udp)
网络·python·udp
字节全栈_rJF2 小时前
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步
网络·智能路由器·php
EchoToMe2 小时前
电信传输基本理论/5G网络层次架构——超三万字详解:适用期末考试/考研/工作
网络·5g·架构
doubt。2 小时前
8.攻防世界Web_php_wrong_nginx_config
网络·安全·web安全·网络安全
Elastic 中国社区官方博客2 小时前
使用真实 Elasticsearch 进行高级集成测试
大数据·数据库·elasticsearch·搜索引擎·全文检索·jenkins·集成测试
@_@哆啦A梦2 小时前
Redis 基础命令
java·数据库·redis
fajianchen2 小时前
MySQL 索引存储结构
数据库·mysql
没有名字的小羊3 小时前
Cyber Security 101-Build Your Cyber Security Career-Security Principles(安全原则)
运维·网络·安全