示例:配置从 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;
}
}
}
}
}
}
traffic-control 配置文件 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 提供的丢弃配置文件名称的配置,作为订阅者登录时提供的(for 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 . . .
}
}
}