示例:配置从 RADIUS 动态获取的初始 CoS 参数
以下配置是客户端动态配置文件的一个示例,其中,当用户通过应用动态配置文件的接口进行身份验证时,将从 RADIUS 服务器动态获取初始 CoS 参数。
在此示例中,假设已为RADIUS 身份验证服务器配置了流量整形参数(在瞻博网络 VSA 26-108)以及 CoS 调度和队列参数(在瞻博网络 VSA 26-146)。
用户接口是 EQ DPC 端口上的单个单元静态千兆以太网 VLAN 接口:
[edit]
interfaces {
ge-9/0/3 {
hierarchical-scheduler;
vlan-tagging;
unit 100 {
vlan-id 100;
family inet {
address 192.168.32.2/24;
}
}
}
}
客户端动态配置文件 residential_silver 将流量控制配置文件 tcp_1 连接到使用 $junos-interface-ifd-name 预定义变量在动态配置文件中定义的用户接口。
[edit]
dynamic-profiles {
residential_silver {
interfaces {
“$junos-interface-ifd-name” {
unit “$junos-underlying-interface-unit” {
family inet;
}
}
}
class-of-service {
interfaces {
“$junos-interface-ifd-name” {
unit “$junos-underlying-interface-unit” {
output-traffic-control-profile tcp_1;
}
}
}
}
}
}
流量控制配置文件 tcp_1引用 Junos OS 预定义变量,以便在订阅者登录时从 RADIUS 获取调度器映射名称和流量整形参数值。对于此示例,假设 RADIUS 服务器替换 Junos OS 预定义的变量 $junos-cos-scheduler-map scheduler-map name business_smap_1。调度器图 business_smap_1 在客户端动态配置文件中配置:
[edit]
dynamic-profiles {
residential_silver {
class-of-service {
traffic-control-profiles {
tcp_1 {
scheduler-map “$junos-cos-scheduler-map”; # ’business_smap_1’
shaping-rate "$junos-cos-shaping-rate";
guaranteed-rate "$junos-cos-guaranteed-rate";
delay-buffer-rate "$junos-cos-delay-buffer-rate";
}
}
scheduler-maps {
business_smap_1 {
forwarding-class best-effort scheduler be_sched;
forwarding-class ef scheduler home_sched
}
}
}
}
}
调度器定义引用 Junos OS 预定义变量,以便在订阅者登录时从 RADIUS 获取调度器配置。对于此示例,假设 RADIUS 服务器为名为 be_sched 和 home_sched的调度器提供调度器配置,这些调度器配置包含在调度器映射 business_smap_1中:
[edit]
dynamic-profiles {
residential_silver {
class-of-service {
schedulers {
“$junos-cos-scheduler” { # ’be_sched’ and ’home_sched’
transmit-rate "$junos-cos-scheduler-tx";
buffer-size "$junos-cos-scheduler-bs";
priority "$junos-cos-scheduler-pri";
drop-profile-map loss-priority low protocol any drop-profile “$junos-cos-scheduler-dropfile-low“;
drop-profile-map loss-priority medium-low protocol any drop-profile “$junos-cos-scheduler-dropfile-medium-low“;
drop-profile-map loss-priority medium-high protocol any drop-profile “$junos-cos-scheduler-dropfile-medium-high“;
drop-profile-map loss-priority high protocol any drop-profile “$junos-cos-scheduler-dropfile-high“;
}
}
}
}
}
CoS 的静态配置包括调度器映射 business_smap_1 中使用的转发类配置,以及 RADIUS 提供的丢弃配置文件名称配置,作为用户登录时提供的调度器配置的一部分(用于 be_sched home_sched和 ):
[edit]
class-of-service {
forwarding-classes {
queue 0 best-effort;
queue 1 ef;
}
drop-profiles {
. . . configurations_for_drop_profile_names_provided_by_RADIUS . . .
}
}
}