- play_arrow 配置防火墙过滤器
- play_arrow 了解防火墙过滤器如何保护您的网络
- play_arrow 防火墙过滤器匹配条件和操作
- 防火墙过滤器概述(OCX 系列)
- ACX 系列路由器上的防火墙过滤器配置文件概述(Junos OS 演化版)
- 了解防火墙过滤器匹配条件
- 了解防火墙过滤器规划
- 了解如何评估防火墙过滤器
- 了解防火墙过滤器匹配条件
- 防火墙过滤器灵活匹配条件
- 防火墙过滤器非终止操作
- 防火墙过滤器终止操作
- 防火墙过滤器匹配条件和操作(ACX 系列路由器)
- ACX 系列路由器中的防火墙过滤器匹配条件和操作 (Junos OS 演化版)
- 与协议无关的流量的防火墙过滤器匹配条件
- IPv4 流量的防火墙过滤器匹配条件
- IPv6 流量的防火墙过滤器匹配条件
- 基于数字或文本别名的防火墙过滤器匹配条件
- 基于位字段值的防火墙过滤器匹配条件
- 基于地址字段的防火墙过滤器匹配条件
- 基于地址类的防火墙过滤器匹配条件
- 了解 MPLS 流量的基于 IP 的过滤和选择性端口镜像
- MPLS 流量的防火墙过滤器匹配条件
- MPLS 标记的 IPv4 或 IPv6 流量的防火墙过滤器匹配条件
- VPLS 流量的防火墙过滤器匹配条件
- 第 2 层 CCC 流量的防火墙过滤器匹配条件
- 第 2 层桥接流量的防火墙过滤器匹配条件
- 环路接口上的防火墙过滤器支持
- play_arrow 将防火墙过滤器应用于路由引擎流量
- 在第 3 层 VPN 中的路由实例的环路接口上配置逻辑单元
- 示例:配置过滤器以根据前缀列表限制对端口的 TCP 访问
- 示例:配置无状态防火墙过滤器以接受来自可信源的流量
- 示例:配置过滤器以阻止 Telnet 和 SSH 访问
- 示例:配置过滤器以阻止 TFTP 访问
- 示例:配置过滤器以接受基于 IPv6 TCP 标志的数据包
- 示例:配置过滤器以阻止对端口的 TCP 访问(来自指定 BGP 对等方除外)
- 示例:配置无状态防火墙过滤器以防止 TCP 和 ICMP 泛滥
- 示例:使用每秒数据包数速率限制过滤器保护路由引擎
- 示例:配置过滤器以排除 LAC 订阅者的 DHCPv6 和 ICMPv6 控制流量
- DHCP 防火墙过滤器的端口号要求
- 示例:配置 DHCP 防火墙过滤器以保护路由引擎
- play_arrow 将防火墙过滤器应用于传输流量
- 示例:配置过滤器以用作入口队列过滤器
- 示例:配置过滤器以匹配 IPv6 标志
- 示例:配置过滤器以匹配端口和协议字段
- 示例:配置过滤器以计算接受和拒绝的数据包
- 示例:配置过滤器以计数和丢弃 IP 选项数据包
- 示例:配置过滤器以对 IP 选项数据包进行计数
- 示例:配置过滤器以对接受的数据包进行计数和采样
- 示例:配置过滤器以将 DSCP 位设置为零
- 示例:配置过滤器以将 DSCP 位设置为零
- 示例:将筛选器配置为匹配两个不相关的条件
- 示例:将过滤器配置为基于地址接受 DHCP 数据包
- 示例:配置过滤器以接受来自前缀的 OSPF 数据包
- 示例:配置无状态防火墙过滤器以处理片段
- 配置防火墙过滤器以防止或允许 IPv4 数据包分段
- 配置防火墙过滤器以丢弃带有移动扩展标头的入口 IPv6 数据包
- 示例:基于 IPv6 源或目标 IP 地址配置出口过滤器
- 示例:基于目标类配置速率限制过滤器
- play_arrow 在逻辑系统中配置防火墙过滤器
- play_arrow 配置防火墙过滤器记帐和日志记录
- play_arrow 将多个防火墙过滤器连接到单个接口
- play_arrow 将单个防火墙过滤器连接到多个接口
- play_arrow 配置跨 IP 网络的基于过滤器的隧道
- play_arrow 配置服务过滤器
- play_arrow 配置简单筛选器
- play_arrow 配置第 2 层防火墙过滤器
- play_arrow 为转发、分段和监管配置防火墙过滤器
- play_arrow 配置防火墙过滤器(EX 系列交换机)
- EX 系列交换机的防火墙过滤器概述
- 了解防火墙过滤器的规划
- 了解防火墙过滤器匹配条件
- 了解防火墙过滤器如何控制数据包流
- 了解如何评估防火墙过滤器
- 了解 EX 系列交换机上桥接数据包和路由数据包的防火墙过滤器处理点
- EX 系列交换机的防火墙过滤器匹配条件、操作和操作修改符
- EX 系列交换机上防火墙过滤器匹配条件、操作和操作修饰符的平台支持
- 支持交换机上环路防火墙过滤器的匹配条件和操作
- 配置防火墙过滤器(CLI 过程)
- 了解防火墙过滤器如何测试数据包的协议
- 了解 EX 系列交换机基于过滤器的转发
- 示例:为 EX 系列交换机上的端口、VLAN 和路由器流量配置防火墙过滤器
- 示例:在 EX 系列交换机的管理接口上配置防火墙过滤器
- 示例:使用基于过滤器的转发将应用程序流量路由到安全设备
- 示例:将防火墙过滤器应用于启用了 802.1X 或 MAC RADIUS 身份验证的接口上的多个请求方
- 验证监管器是否正常运行
- 防火墙过滤器故障排除
- play_arrow 配置防火墙过滤器(QFX 系列交换机、EX4600 交换机、PTX 系列路由器)
- 防火墙过滤器概述(QFX 系列)
- 了解防火墙过滤器规划
- 规划要创建的防火墙过滤器数量
- 防火墙过滤器匹配条件和操作(QFX 和 EX 系列交换机)
- 防火墙过滤器匹配条件和操作(QFX10000交换机)
- 防火墙过滤器匹配条件和操作(PTX 系列路由器)
- PTX 系列数据包传输路由器和 T 系列矩阵路由器之间的防火墙和监管差异
- 配置防火墙过滤器
- 将防火墙过滤器应用于接口
- 环路接口上的 MPLS 防火墙过滤器概述
- 在交换机上配置 MPLS 防火墙过滤器和监管器
- 在路由器上配置 MPLS 防火墙过滤器和监管器
- 配置 MPLS 防火墙过滤器和监管器
- 了解防火墙过滤器如何测试协议
- 了解桥接和路由数据包的防火墙过滤器处理点
- 了解基于过滤器的转发
- 示例:使用基于过滤器的转发将应用程序流量路由到安全设备
- 配置防火墙过滤器以解封装 GRE 或 IPIP 流量
- 验证防火墙过滤器是否正常运行
- 监控防火墙过滤器流量
- 防火墙过滤器配置疑难解答
- play_arrow 配置防火墙过滤器计费和日志记录(EX9200 交换机)
-
- play_arrow 配置流量监管器
- play_arrow 了解流量监管器
- 监管器实施概述
- ARP 监管器概述
- 示例:配置 ARP 监管器
- 了解监管器和令牌桶算法的优势
- 确定流量监管器的适当突发大小
- 使用流量监管控制网络访问概述
- 流量监管器类型
- 监管器和防火墙过滤器操作的顺序
- 了解监管数据包的帧长度
- 支持的监管标准
- 分层监管器配置概述
- 了解增强型分层监管器
- 基于每秒数据包数 (pps) 的监管器概述
- 应用流量监管器的准则
- 聚合以太网接口的监管器支持概述
- 示例:为物理接口上的聚合流量配置物理接口监管器
- PTX 系列数据包传输路由器和 T 系列矩阵路由器之间的防火墙和监管差异
- ACX 系列路由器上的分层监管器概述
- 在 ACX 系列路由器上配置分层监管器的准则
- ACX 系列路由器上的分层监管器模式
- 处理 ACX 系列路由器上的分层监管器
- 对 ACX 系列路由器上的分层监管器执行的操作
- 在 ACX 系列路由器上配置聚合父监管器和子监管器
- play_arrow 配置监管器速率限制和操作
- play_arrow 配置第 2 层监管器
- play_arrow 在第 3 层配置双色和三色流量监管器
- play_arrow 在第 3 层配置逻辑和物理接口流量监管器
- play_arrow 在交换机上配置监管器
-
- play_arrow 配置语句和操作命令
- play_arrow 故障排除
- play_arrow 知识库
-
示例:使用复杂的正则表达式测试路由策略
此示例说明如何使用命令测试 test policy
路由策略,以确保策略在生产环境中应用之前产生预期的结果。正则表达式,尤其是复杂的正则表达式,可能很难正确。此示例演示如何使用命令来 test policy
确保正则表达式具有预期效果。
概述
此示例显示了两台路由设备之间具有外部 BGP (EBGP) 连接。设备 R2 使用 BGP 会话将客户路由发送到设备 R1。这些静态路由附加了多个社区值。
user@R2> show route match-prefix 172.16.* detail inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) 172.16.1.0/24 (1 entry, 1 announced) *Static Preference: 5 Next hop type: Reject Address: 0x8fd0dc4 Next-hop reference count: 8 State: <Active Int Ext> Local AS: 64511 Age: 21:32:13 Validation State: unverified Task: RT Announcement bits (1): 0-KRT AS path: I Communities: 64510:1 64510:10 64510:11 64510:100 64510:111 172.16.2.0/24 (1 entry, 1 announced) *Static Preference: 5 Next hop type: Reject Address: 0x8fd0dc4 Next-hop reference count: 8 State: <Active Int Ext> Local AS: 64511 Age: 21:32:13 Validation State: unverified Task: RT Announcement bits (1): 0-KRT AS path: I Communities: 64510:2 64510:20 64510:22 64510:200 64510:222 172.16.3.0/24 (1 entry, 1 announced) *Static Preference: 5 Next hop type: Reject Address: 0x8fd0dc4 Next-hop reference count: 8 State: <Active Int Ext> Local AS: 64511 Age: 21:32:13 Validation State: unverified Task: RT Announcement bits (1): 0-KRT AS path: I Communities: 64510:3 64510:30 64510:33 64510:300 64510:333 172.16.4.0/24 (1 entry, 1 announced) *Static Preference: 5 Next hop type: Reject Address: 0x8fd0dc4 Next-hop reference count: 8 State: <Active Int Ext> Local AS: 64511 Age: 21:32:13 Validation State: unverified Task: RT Announcement bits (1): 0-KRT AS path: I Communities: 64510:4 64510:40 64510:44 64510:400 64510:444
为了测试复杂的正则表达式,设备 R2 具有一个名为 test-regex
用于定位路由的策略。策略配置如下:
policy-statement test-regex { term find-routes { from community complex-regex; then accept; } term reject-the-rest { then reject; } } community complex-regex members "^64510:[13].*$";
此正则表达式匹配以 1 或 3 开头的社区值。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改与您的网络配置匹配所需的任何详细信息,然后将命令复制并粘贴到层次结构级别的 CLI [edit]
中。
设备 R1
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.1/30 set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set protocols bgp group ext type external set protocols bgp group ext peer-as 64511 set protocols bgp group ext neighbor 10.0.0.2 set routing-options router-id 192.168.0.1 set routing-options autonomous-system 64510
设备 R2
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.2/30 set interfaces lo0 unit 0 family inet address 192.168.0.2/32 set protocols bgp group ext type external set protocols bgp group ext peer-as 64510 set protocols bgp group ext neighbor 10.0.0.1 set policy-options policy-statement send-static term 1 from protocol static set policy-options policy-statement send-static term 1 then accept set policy-options policy-statement send-static term 2 then reject set policy-options policy-statement test-regex term find-routes from community complex-regex set policy-options policy-statement test-regex term find-routes then accept set policy-options policy-statement test-regex term reject-the-rest then reject set policy-options community complex-regex members "^64510:[13].*$" set routing-options static route 172.16.1.0/24 reject set routing-options static route 172.16.1.0/24 community 64510:1 set routing-options static route 172.16.1.0/24 community 64510:10 set routing-options static route 172.16.1.0/24 community 64510:11 set routing-options static route 172.16.1.0/24 community 64510:100 set routing-options static route 172.16.1.0/24 community 64510:111 set routing-options static route 172.16.2.0/24 reject set routing-options static route 172.16.2.0/24 community 64510:2 set routing-options static route 172.16.2.0/24 community 64510:20 set routing-options static route 172.16.2.0/24 community 64510:22 set routing-options static route 172.16.2.0/24 community 64510:200 set routing-options static route 172.16.2.0/24 community 64510:222 set routing-options static route 172.16.3.0/24 reject set routing-options static route 172.16.3.0/24 community 64510:3 set routing-options static route 172.16.3.0/24 community 64510:30 set routing-options static route 172.16.3.0/24 community 64510:33 set routing-options static route 172.16.3.0/24 community 64510:300 set routing-options static route 172.16.3.0/24 community 64510:333 set routing-options static route 172.16.4.0/24 reject set routing-options static route 172.16.4.0/24 community 64510:4 set routing-options static route 172.16.4.0/24 community 64510:40 set routing-options static route 172.16.4.0/24 community 64510:44 set routing-options static route 172.16.4.0/24 community 64510:400 set routing-options static route 172.16.4.0/24 community 64510:444 set routing-options router-id 192.168.0.2 set routing-options autonomous-system 64511
程序
分步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 R2:
配置接口。
content_copy zoom_out_map[edit interfaces] user@R2# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30 user@R2# set lo0 unit 0 family inet address 192.168.0.2/32
配置 BGP。
将导入策略应用于与设备 R2 的 BGP 对等会话。
content_copy zoom_out_map[edit protocols bgp group ext] user@R2# set type external user@R2# set peer-as 64510 user@R2# set neighbor 10.0.0.1
配置发送静态路由的路由策略。
content_copy zoom_out_map[edit policy-options policy-statement send-static] user@R2# set term 1 from protocol static user@R2# set term 1 then accept user@R2# set term 2 then reject
配置测试正则表达式的路由策略。
content_copy zoom_out_map[edit policy-options policy-statement test-regex] user@R2# set term find-routes from community complex-regex user@R2# set term find-routes then accept user@R2# set term reject-the-rest then reject [edit policy-options community] user@R2# set complex-regex members "^64510:[13].*$"
配置静态路由并附加社区值。
content_copy zoom_out_map[edit routing-options static route 172.16.1.0/24] user@R2# set reject user@R2# set community [ 64510:1 64510:10 64510:11 64510:100 64510:111 ] [edit routing-options static route 172.16.2.0/24] user@R2# set reject user@R2# set community [ 64510:2 64510:20 64510:22 64510:200 64510:222 ] [edit routing-options static route 172.16.3.0/24] user@R2# set reject user@R2# set community [ 64510:3 64510:30 64510:33 64510:300 64510:333 ] [edit routing-options static route 172.16.4.0/24] user@R2# set reject user@R2# set community [ 64510:4 64510:40 64510:44 64510:400 64510:444 ]
配置自治系统 (AS) 编号和路由器 ID。
这会影响设备 R2 的路由表,并且不会影响设备 R1 和设备 R3。
content_copy zoom_out_map[edit routing-options ] user@R2# set router-id 192.168.0.2 user@R2# set autonomous-system 64511
结果
在配置模式下,输入 show interfaces
、show protocols
、show policy-options
和 show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以便进行更正。
user@R2# show interfaces fe-1/2/0 { unit 0 { family inet { address 10.0.0.2/30; } } } lo0 { unit 0 { family inet { address 192.168.0.2/32; } } }
user@R2# show protocols bgp { group ext { type external; peer-as 64510; neighbor 10.0.0.1; } }
user@R2# show policy-options policy-statement send-static { term 1 { from protocol static; then accept; } term 2 { then reject; } } policy-statement test-regex { term find-routes { from community complex-regex; then accept; } term reject-the-rest { then reject; } } community complex-regex members "^64510:[13].*$";
user@R2# show routing-options static { route 172.16.1.0/24 { reject; community [ 64510:1 64510:10 64510:11 64510:100 64510:111 ]; } route 172.16.2.0/24 { reject; community [ 64510:2 64510:20 64510:22 64510:200 64510:222 ]; } route 172.16.3.0/24 { reject; community [ 64510:3 64510:30 64510:33 64510:300 64510:333 ]; } route 172.16.4.0/24 { reject; community [ 64510:4 64510:40 64510:44 64510:400 64510:444 ]; } } router-id 192.168.0.2; autonomous-system 64511;
如果完成设备配置,请从配置模式输入 commit
。
验证
确认配置工作正常。
测试以查看哪些社区与正则表达式匹配
目的
您可以使用命令 test policypolicy-name
测试正则表达式及其策略。
操作
在设备 R2 上,运行
test policy test-regex 0/0
命令。content_copy zoom_out_mapuser@R2> test policy test-regex 0/0 inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 172.16.1.0/24 *[Static/5] 1d 00:32:50 Reject 172.16.3.0/24 *[Static/5] 1d 00:32:50 Reject Policy test-regex: 2 prefix accepted, 5 prefix rejected
在设备 R2 上,更改正则表达式以匹配包含任意数量的数字 2 实例的社区值。
content_copy zoom_out_map[edit policy-options community complex-regex] user@R2# delete members "^64510:[13].*$" user@R2# set members "^65020:2+$" user@R2# commit
在设备 R2 上,重新运行
test policy test-regex 0/0
命令。content_copy zoom_out_mapuser@R2> test policy test-regex 0/0 inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 172.16.2.0/24 *[Static/5] 1d 00:31:36 Reject Policy test-regex: 1 prefix accepted, 6 prefix rejected
意义
172.16.1.0 /24 和 172.16.3.0/24 路由都附加了与 ^64510:[13].*$ 表达式匹配的社区。172.16.2.0/24 路由具有与 ^65020:2+$ 表达式匹配的社区。