示例:在 PTX 系列数据包传输路由器中配置虚拟 LAN 队列和整形
您可以在 PTX 系列数据包传输路由器上的 100 千兆以太网接口上启用虚拟 LAN (VLAN) 队列,并为每个 VLAN 指定流量整形速率。
要求
此示例使用以下硬件和软件组件:
Junos OS 13.2 或更高版本。
一台 PTX5000 路由器。
概述
此示例说明如何配置 10 个 VLAN,启用服务等级 (CoS) 队列,以及为每个 VLAN 指定流量整形速率。所有 VLAN 的总流量整形速率不能超过 100 Gbps。
配置
CLI 快速配置
要配置 PTX5000 路由器上的 VLAN 队列和流量整形,请复制以下命令并将其粘贴到路由器的终端窗口中:
[edit] set interfaces et-5/0/0 vlan-tagging set interfaces et-5/0/0 per-unit-scheduler set interfaces et-5/0/0 unit 0 vlan-id 0 set interfaces et-5/0/0 unit 1 vlan-id 1 set interfaces et-5/0/0 unit 2 vlan-id 2 set interfaces et-5/0/0 unit 3 vlan-id 3 set interfaces et-5/0/0 unit 4 vlan-id 4 set interfaces et-5/0/0 unit 5 vlan-id 5 set interfaces et-5/0/0 unit 6 vlan-id 6 set interfaces et-5/0/0 unit 7 vlan-id 7 set interfaces et–5/0/0 unit 8 vlan-id 8 set interfaces et-5/0/0 unit 9 vlan-id 9 set class-of-service interfaces et-5/0/0 unit 0 shaping-rate 5g set class-of-service interfaces et-5/0/0 unit 1 shaping-rate 10g set class-of-service interfaces et-5/0/0 unit 2 shaping-rate 20g set class-of-service interfaces et-5/0/0 unit 3 shaping-rate 5g set class-of-service interfaces et-5/0/0 unit 4 shaping-rate 10g set class-of-service interfaces et-5/0/0 unit 5 shaping-rate 10g set class-of-service interfaces et-5/0/0 unit 6 shaping-rate 5g set class-of-service interfaces et-5/0/0 unit 7 shaping-rate 5g set class-of-service interfaces et-5/0/0 unit 8 shaping-rate 10g set class-of-service interfaces et-5/0/0 unit 9 shaping-rate 20g
程序
逐步过程
要配置 PTX5000 路由器:
在接口上启用 8021.q VLAN 标记帧的接收和传输:
[edit interfaces] user@host# set et-5/0/0 vlan-tagging
为每个逻辑接口指定 VLAN 标识符:
[edit interfaces] user@host# set et-5/0/0 unit 0 vlan-id 0 user@host# set et-5/0/0 unit 1 vlan-id 1 user@host# set et-5/0/0 unit 2 vlan-id 2 user@host# set et-5/0/0 unit 3 vlan-id 3 user@host# set et-5/0/0 unit 4 vlan-id 4 user@host# set et–5/0/0 unit 5 vlan-id 5 user@host# set et-5/0/0 unit 6 vlan-id 6 user@host# set et-5/0/0 unit 7 vlan-id 7 user@host# set et-5/0/0 unit 8 vlan-id 8 user@host# set et-5/0/0 unit 9 vlan-id 9
通过指定要分配给每个逻辑接口的带宽量,配置每 VLAN 流量整形:
[edit class-of-service interfaces] user@host# set et-5/0/0 unit 0 shaping-rate 5g user@host# set et-5/0/0 unit 1 shaping-rate 10g user@host# set et-5/0/0 unit 2 shaping-rate 20g user@host# set et-5/0/0 unit 3 shaping-rate 5g user@host# set et-5/0/0 unit 4 shaping-rate 10g user@host# set et-5/0/0 unit 5 shaping-rate 10g user@host# set et-5/0/0 unit 6 shaping-rate 5 g user@host# set et-5/0/0 unit 7 shaping-rate 5g user@host# set et-5/0/0 unit 8 shaping-rate 10g user@host# set et-5/0/0 unit 0 shaping-rate 20g
结果
输入和 show class-of-service 命令以确认show interfaces您的结果:
user@host# show interfaces
et-5/0/0 {
vlan-tagging;
unit 0 {
vlan-id 0;
}
unit 1 {
vlan-id 1;
}
unit 2 {
vlan-id 2;
}
unit 3 {
vlan-id 3;
}
unit 4 {
vlan-id 4;
}
unit 5 {
vlan-id 5;
}
unit 6 {
vlan-id 6;
}
unit 7 {
vlan-id 7;
}
unit 8 {
vlan-id 8;
}
unit 9 {
vlan-id 9;
}
}
user@host# show class-of-service
interfaces {
et-5/0/3 {
unit 0 {
shaping-rate 5g;
}
unit 1 {
shaping-rate 10g;
}
unit 2 {
shaping-rate 20g;
}
unit 3 {
shaping-rate 5g;
}
unit 4 {
shaping-rate 10g;
}
unit 5 {
shaping-rate 10g;
}
unit 6 {
shaping-rate 5g;
}
unit 7 {
shaping-rate 5g;
}
unit 8 {
shaping-rate 10g;
}
unit 9 {
shaping-rate 20g;
}
}
}