在包含互联网处理器 II 应用特定集成电路 (ASIC) 的路由器上,可以将 IP 版本 4 (IPv4) 或 IP 版本 6 (IPv6) 数据包的副本从路由器发送到外部主机地址或数据包分析器进行分析。这称为 端口镜像。
端口镜像不同于流量采样。在流量采样中,基于 IPv4 报头的采样密钥被发送到路由引擎。在那里,可以将密钥放入文件中,或者可以将基于密钥的 cflowd 数据包发送到 cflowd 服务器。在端口镜像中,整个数据包被复制并通过下一跃点接口发送出去。
您可以配置同时使用采样和端口镜像,并为端口镜像数据包设置独立的采样速率和运行长度。但是,如果同时选择一个数据包进行采样和端口镜像,则只能执行一个作,端口镜像优先。例如,如果将接口配置为对接口输入的每个数据包进行采样,并且过滤器还选择要将端口镜像到其他接口的数据包,则仅端口镜像生效。在转发到最终目的地时,继续对与显式过滤器端口镜像标准不匹配的所有其他数据包进行采样。
下一跃点组允许您在多个接口上包含端口镜像。
在 MX 系列路由器上,您可以将隧道接口输入流量镜像到多个目标。对于这种形式的多数据包端口镜像,您可以在下一跳组中指定两个或多个目标,定义一个将下一跃点组引用为过滤作的防火墙过滤器,然后将过滤器应用于逻辑隧道接口 lt-)或虚拟隧道接口(vt- 在 MX 系列路由器上)。
要为第 2 层端口镜像防火墙过滤器作定义下一跃点组:
- 启用转发选项的配置。
[edit]
user@host set forwarding-options port-mirroring family (inet | inet6) output
- 启用第 2 层端口镜像的下一跳组配置。
[edit forwarding-options port-mirroring ... family (inet | inet6) output]
user@host# set next-hop-group next-hop-group-name
- 指定下一跳组配置中使用的地址类型。
[edit forwarding-options port-mirroring ... family (inet | inet6) output next-hop-group next-hop-group-name]
user@host# set group-type inet6
- 指定下一跃点路由的接口。
[edit forwarding-options port-mirroring ... family (inet | inet6) output next-hop-group next-hop-group-name]
user@host# set interface logical-interface-name-1
user@host# set interface logical-interface-name-2
或
[edit forwarding-options port-mirroring ... family (inet | inet6) output next-hop-group next-hop-group-name]
user@host# set interface interface-name next-hop next-hop-address
MX 系列路由器支持多达 30 个下一跳点组。每个下一跳组最多支持 16 个下一跳地址。每个下一跳组必须至少指定两个地址。可以 next-hop-address 是 IPv4 或 IPv6 地址。
- (可选)指定下一跃点子组。
[edit forwarding-options port-mirroring ... family (inet | inet6) output next-hop-group next-hop-group-name]
user@host# set next-hop-subgroup subgroup-name interface interface-name next-hop next-hop-address
- 验证下一跃点组的配置。
[edit forwarding-options port-mirroring ... family (inet | inet6) output next-hop-group next-hop-group-name]
user@host# top
[edit]
user@host# show forwarding-options
...
next-hop-group next-hop-group-name {
group-type inet6;
interface logical-interface-name-1;
interface interface-name{
next-hop next-hop-address;
}
next-hop-subgroup subgroup-name{
interface interface-name{
next-hop next-hop-address;
}
}
}
...
变更历史表
是否支持某项功能取决于您使用的平台和版本。使用 功能资源管理器 确定您的平台是否支持某个功能。
14.2
从版本 14.2 开始,在包含互联网处理器 II 特定于应用集成电路 (ASIC) 的路由器上,您可以将 IP 版本 4 (IPv4) 或 IP 版本 6 (IPv6) 数据包的副本从路由器发送到外部主机地址或数据包分析器进行分析。