示例:带 LAG 链路的第2层 VPN 的第2层端口镜像
以下示例不是完整配置,但显示了使用以下方法在 L2VPN 上配置端口镜像所需的所有步骤: 系列 ccc和聚合以太网链路。
配置 VLAN port_mirror_bd,其中包含外部数据包分析器:
[edit]vlans {port_mirror_vlan { # Contains an external traffic analyzerinterface ge-2/2/8.0; # External analyzer}}配置第 2 层 VPN CCC 以连接接口 ae0.0和接口 ae0.1可以:
[edit]protocols {mpls {interface all;}connections {interface-switch if_switch {interface ae0.0;interface ae0.1;}}}为全局 实例配置2层端口镜像,端口镜像目标为与外部分析器关联的 VLAN 接口(逻辑接口 ge-2/2/9.0在 VLAN example_bd_with_analyzer):
[edit]forwarding-options {port-mirroring {input {rate 1;maximum-packet-length 200;}family ccc {output {interface ge-2/2/8.0; # Mirror packets to the external analyzer}}instance {pm_instance_1 {input {rate 1;maximum-packet-length 300;}family ccc {output {interface ge-2/2/8.0;}{}}}}配置防火墙过滤器 pm_ccc(对于 系列 ccc可以:
[edit]firewall {family ccc {filter pm_ccc {term pm {then port-mirror;}}}}将聚合以太网接口和端口镜像实例应用于机箱:
[edit]chassis {aggregated-devices {ethernet {device-count 10;}}fpc 2 {port-mirror-instance pm_instance_1;}}配置接口 ae0及 ge-2/0/2(用于聚合以太网)和 ge-2/2/8(用于端口镜像), pm_ccc过滤
[edit]interfaces {ae0 {vlan-tagging;encapsulation extended-vlan-ccc;unit 0 {vlan-id 10;family ccc {filter {input pm_ccc;}}}unit 1 {vlan-id 20;family ccc {filter {output pm_ccc;}}}}ge-2/0/2 {gigether-options {802.3ad ae0;}}ge-2/2/8 {encapsulation ethernet-bridge;unit 0 {family ethernet-switching;}}}