示例:分隔聚合以太网接口上的 Demux 订阅者的目标组播流量
此示例演示如何将目标组播流量与目标单播流量分离,并通过使用 OIF 图将组播流量发送到不同接口。
要求
配置此示例之前,请确保配置接口的分配类型。有关 说明,请参阅 在聚合以太网接口上为 Demux 订阅者配置分发类型 。
概述
此示例已在路由器上配置了目标流量分配。动态创建的接口各自承载其单播流量,但所有组播流量均发送至 ge-5/3/9.0 接口。
配置
CLI快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以匹配网络配置,然后将命令复制并粘贴到 层次结构级别的 CLI [edit] 中。
set policy-options policy-statement OIF-v4-all term oif539 from route-filter 192.168.20.0/4 orlonger set policy-options policy-statement OIF-v4-all term oif539 then map-to-interface ge-5/3/9.0 set policy-options policy-statement OIF-v4-all term oif539 then accept set dynamic-profiles dhcp-vlan-prof interfaces "$junos-interface-ifd-name" unit "$junos-underlying-interface-unit" family inet unnumbered-address lo0.0 set dynamic-profiles dhcp-vlan-prof interfaces "$junos-interface-ifd-name" unit "$junos-underlying-interface-unit" family inet unnumbered-address preferred-sour ce-address 10.20.0.2 set dynamic-profiles demux-vlan-prof interfaces demux0 unit "$junos-interface-un it" vlan-id "$junos-vlan-id" set dynamic-profiles demux-vlan-prof interfaces demux0 unit "$junos-interface-un it" demux-options underlying-interface "$junos-interface-ifd-name" set dynamic-profiles demux-vlan-prof interfaces demux0 unit "$junos-interface-un it" targeted-distribution set dynamic-profiles demux-vlan-prof interfaces demux0 unit "$junos-interface-un it" family inet unnumbered-address lo0.0 set dynamic-profiles demux-vlan-prof interfaces demux0 unit "$junos-interface-un it" family inet unnumbered-address preferred-source-address 10.20.0.2 set dynamic-profiles demux-vlan-prof protocols igmp interface "$junos-interface- name" version 2 set dynamic-profiles demux-vlan-prof protocols igmp interface "$junos-interface- name" promiscuous-mode set dynamic-profiles demux-vlan-prof protocols igmp interface "$junos-interface- name" passive allow-receive set dynamic-profiles demux-vlan-prof protocols igmp interface "$junos-interface- name" passive send-group-query set dynamic-profiles demux-vlan-prof protocols igmp interface "$junos-interface- name" oif-map OIF-v4-all
配置 OIF 映射策略
逐步过程
以下示例要求您在配置层次结构中导航各个级别。
要配置 OIF 映射:
访问路由器策略选项:
[edit] user@host#edit policy-options
编辑策略语句。
[edit policy-options] user@host edit policy-statement OIF-v4-all
创建用于将传入组播信息流映射到特定接口的术语。
[edit policy-options OIF-v4-all] user@host edit term oif539
定义术语的匹配条件。在这种情况下,术语匹配 192.168.20.0/4 或更长任何路由前缀(所有组播流量)。
[edit policy-options OIF-v4-all term oif539] user@host set from route-filter 192.168.20.0/4 orlonger
-
定义术语的操作。在这种情况下,发生匹配时,术语接受信息流,并映射到接口 ge-5/3/9.0。
[edit policy-options OIF-v4-all term oif539] user@host set then map-to-interface ge-5/3/9.0 user@host set then accept
结果
发出命令以确认您的 show policy-options 配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
[edit]
user@host# show policy-options
policy-statement OIF-v4-all {
term oif539 {
from {
route-filter 192.168.20.0/4 orlonger;
}
then {
map-to-interface ge-5/3/9.0;
accept;
}
}
}
配置 DHCP VLAN 动态配置文件
逐步过程
以下示例要求您在配置层次结构中导航各个级别。
要配置 DHCP VLAN 动态配置文件以用于客户端访问:
创建动态 VLAN 多路复用配置文件。
[edit] user@host#edit dynamic-profiles dhcp-vlan-prof
编辑动态配置文件接口。
[edit dynamic-profiles dhcp-vlan-prof] user@host edit interfaces $junos-ifd-name
编辑接口单元动态变量。
[edit dynamic-profiles demux-vlan-prof interfaces $junos-ifd-name] user@host edit unit $junos-underlying-interface-unit
编辑接口族。
[edit dynamic-profiles demux-vlan-prof interfaces $junos-ifd-name unit $junos-underlying-interface-unit] user@host edit family inet
定义环路地址。
[edit dynamic-profiles demux-vlan-prof interfaces $junos-ifd-name unit $junos-underlying-interface-unit ] user@host set unnumbered-address lo0.0 preferred-source-address 10.20.0.2
结果
发出 命令以确认您的 show dynamic-profiles 配置。如果 dhcp-vlan-prof 动态配置文件的输出未显示预期的配置,请重复此示例中的说明,以更正配置。
[edit]
user@host# show dynamic-profiles
dhcp-vlan-prof {
interfaces {
"$junos-interface-ifd-name" {
unit "$junos-underlying-interface-unit" {
family inet {
unnumbered-address lo0.0 preferred-source-address 10.20.0.2;
}
}
}
}
}
配置 VLAN Demux 动态配置文件
逐步过程
以下示例要求您在配置层次结构中导航各个级别。
要配置 OIF 映射:
创建动态 VLAN 多路复用配置文件。
[edit] user@host#edit dynamic-profiles demux-vlan-prof
编辑动态配置文件 demux0 接口。
[edit dynamic-profiles demux-vlan-prof] user@host edit interfaces demux0
编辑接口单元动态变量。
[edit dynamic-profiles demux-vlan-prof interfaces demux0] user@host edit unit $junos-interface-unit
指定 VLAN ID 动态变量。
[edit dynamic-profiles demux-vlan-prof interfaces demux0 unit �$junos-interface-unit�] user@host set vlan-id $junos-vlan-id
访问多路复用选项。
[edit dynamic-profiles demux-vlan-prof interfaces demux0 unit �$junos-interface-unit�] user@host edit demux-options
定义多路复用底层接口。
[edit dynamic-profiles demux-vlan-prof interfaces demux0 unit �$junos-interface-unit� demux-options] user@host set underlying-interface $junos-interface-ifd-name
指定使用目标分配来动态创建 VLAN。
[edit dynamic-profiles demux-vlan-prof interfaces demux0 unit �$junos-interface-unit�] user@host set targeted-distribution
编辑接口族。
[edit dynamic-profiles demux-vlan-prof interfaces demux0 unit �$junos-interface-unit�] user@host edit family inet
定义环路地址。
[edit dynamic-profiles demux-vlan-prof interfaces demux0 unit �$junos-interface-unit� family inet] user@host set unnumbered-address lo0.0 preferred-source-address 10.20.0.2
编辑动态配置文件 IGMP 协议。
[edit dynamic-profiles demux-vlan-prof] user@host edit protocols igmp
在动态创建的接口上启用 IGMP。
[edit dynamic-profiles demux-vlan-prof protocols igmp] user@host edit interface $junos-interface-name
指定您希望动态创建接口使用的 IGMP 版本。
[edit dynamic-profiles demux-vlan-prof protocols igmp interface $junos-interface-name] user@host set version 2
指定要动态创建 IGMP 接口使用的 OIF 映射。
[edit dynamic-profiles demux-vlan-prof protocols igmp interface $junos-interface-name] user@host set oif-map OIF-v4-all
指定 IGMP 有选择性地发送和接收控制信息流,例如 IGMP 报告、查询和离开。
[edit dynamic-profiles demux-vlan-prof protocols igmp interface $junos-interface-name] user@host set passive allow-receive send-group-query
指定接口接受来自任何子网上主机的 IGMP 报告。
[edit dynamic-profiles demux-vlan-prof protocols igmp interface $junos-interface-name] user@host set promiscuous-mode
结果
发出命令以确认您的 show dynamic-profiles 配置。如果 dhcp-vlan-prof 动态配置文件的输出未显示预期的配置,请重复此示例中的说明,以更正配置。
[edit]
user@host# show dynamic-profiles
demux-vlan-prof {
interfaces {
demux0 {
unit "$junos-interface-unit" {
vlan-id "$junos-vlan-id";
demux-options {
underlying-interface "$junos-interface-ifd-name";
}
targeted-distribution;
family inet {
unnumbered-address lo0.0 preferred-source-address 10.20.0.2;
}
}
}
}
protocols {
igmp {
interface "$junos-interface-name" {
version 2;
promiscuous-mode;
passive allow-receive send-group-query;
oif-map OIF-v4-all;
}
}
}
}
...
验证
确认配置工作正常。
找到组播团队成员
目的
找到动态接口,并确保其与相应的 IGMP 组相关联。
行动
user@host>show igmp group
Interface: demux0.1073741824, Groups: 1
Group: 192.0.2.1
Source: 0.0.0.0
Last reported by: 10.20.0.10
Timeout: 52 Type: Dynamic
Interface: local, Groups: 2
Group: 192.0.2.2
Source: 0.0.0.0
Last reported by: Local
Timeout: 0 Type: Dynamic
Group: 192.0.2.22
Source: 0.0.0.0
Last reported by: Local
Timeout: 0 Type: Dynamic
意义
第一 Interface 个字段显示动态创建的多 demux0.1073741824路连接接口,而紧随第一个接口字段下面的 Group 192.0.2.1字段显示用户所属的组。
确保针对订阅者的目标聚合以太网接口正常运行
目的
使用动态用户接口值确保目标聚合接口正常运行。
行动
user@host>show interfaces demux0.1073741824 extensive
Logical interface demux0.1073741824 (Index 810) (SNMP ifIndex 1613)
(Generation 170)
Flags: SNMP-Traps 0x4000 VLAN-Tag [ 0x8100.1 ] Encapsulation: ENET2
Demux:
Underlying interface: ae0 (Index 708)
Link:
ge-1/0/0
ge-5/3/7
Targeting summary:
ge-1/0/0, backup, Physical link is Up
ge-5/3/7, primary, Physical link is Up
Traffic statistics:
Input bytes : 862
Output bytes : 3160
Input packets: 3
Output packets: 30
Local statistics:
Input bytes : 862
Output bytes : 3160
Input packets: 3
Output packets: 30
Transit statistics:
Input bytes : 0 0 bps
Output bytes : 0 0 bps
Input packets: 0 0 pps
Output packets: 0 0 pps
Protocol inet, MTU: 1500, Generation: 212, Route table: 0
Flags: Sendbcast-pkt-to-re, Unnumbered
Donor interface: lo0.0 (Index 802)
Preferred source address: 10.20.0.2
意义
字段 Targeting summary 显示主接口 ( ge-5/3/7) 已启动。
查看目标接口的数据包
目的
验证发送至目标接口 ge-5/3/9 的数据包流量是否仅包含组播数据包。
行动
user@host>show interfaces ge-5/3/9 extensive
Physical interface: ge-5/3/9, Enabled, Physical link is Up
Interface index: 704, SNMP ifIndex: 1605, Generation: 197
Link-level type: Ethernet, MTU: 1514, Speed: 1000mbps, BPDU Error: None,
MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled,
Flow control: Disabled, Auto-negotiation: Enabled, Remote fault: Online
Device flags : Present Running
Interface flags: SNMP-Traps Internal: 0x4000
Link flags : None
CoS queues : 8 supported, 8 maximum usable queues
Schedulers : 0
Hold-times : Up 0 ms, Down 0 ms
Current address: 00:21:59:ab:85:2a, Hardware address: 00:21:59:ab:85:2a
Last flapped : 2012-09-26 17:32:24 EDT (6d 20:44 ago)
Statistics last cleared: Never
Traffic statistics:
Input bytes : 97857650 1320 bps
Output bytes : 0 0 bps
Input packets: 889615 1 pps
Output packets: 0 889620 pps
IPv6 transit statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Dropped traffic statistics due to STP State:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Input errors:
Errors: 0, Drops: 0, Framing errors: 0, Runts: 0, Policed discards: 0,
L3 incompletes: 0, L2 channel errors: 0, L2 mismatch timeouts: 0,
FIFO errors: 0, Resource errors: 0
Output errors:
Carrier transitions: 1, Errors: 0, Drops: 0, Collisions: 0, Aged packets: 0,
FIFO errors: 0, HS link CRC errors: 0, MTU errors: 0, Resource errors: 0
Egress queues: 8 supported, 4 in use
Queue counters: Queued packets Transmitted packets Dropped packets
0 best-effort 0 0 0
1 expedited-fo 0 0 0
2 assured-forw 0 0 0
3 network-cont 0 0 0
Queue number: Mapped forwarding classes
0 best-effort
1 expedited-forwarding
2 assured-forwarding
3 network-control
Active alarms : None
Active defects : None
MAC statistics: Receive Transmit
Total octets 0 113871616
Total packets 0 889620
Unicast packets 0 0
Broadcast packets 0 0
Multicast packets 0 889620
CRC/Align errors 0 0
FIFO errors 0 0
MAC control frames 0 0
MAC pause frames 0 0
Oversized frames 0
Jabber frames 0
Fragment frames 0
VLAN tagged frames 0
Code violations 0
Total errors 0 0
Filter statistics:
Input packet count 0
Input packet rejects 0
Input DA rejects 0
Input SA rejects 0
Output packet count 889620
Output packet pad count 0
Output packet error count 0
CAM destination filters: 0, CAM source filters: 0
Autonegotiation information:
Negotiation status: Complete
Link partner:
Link mode: Full-duplex, Flow control: Symmetric, Remote fault: OK
Local resolution:
Flow control: None, Remote fault: Link OK
Packet Forwarding Engine configuration:
Destination slot: 0 (0x00)
CoS information:
Direction : Output
CoS transmit queue Bandwidth Buffer Priority Limit
% bps % usec
0 best-effort 95 950000000 95 0 low none
3 network-control 5 50000000 5 0 low none
Interface transmit statistics: Disabled
Logical interface ge-5/3/9.0 (Index 818) (SNMP ifIndex 1597) (Generation 149)
Flags: SNMP-Traps 0x4004000 Encapsulation: ENET2
Traffic statistics:
Input bytes : 0
Output bytes : 97857650
Input packets: 0
Output packets: 889620
Local statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Transit statistics:
Input bytes : 0 0 bps
Output bytes : 97857650 1320 bps
Input packets: 0 0 pps
Output packets: 889615 1 pps
Protocol aenet, AE bundle: ae4.0, Generation: 180, Route table: 0
意义
MAC 统计信息 Unicast packet 字段显示接口 Multicast packet 未传输任何单播数据包信息流,而字段显示从接口传输的数据包总数为组播数据包。
