要配置用于零售商访问的动态配置文件,请执行以下操作:
注意:
要支持第 2 层访问配置文件,RADIUS 服务器必须提供 VLAN 身份验证。
- 创建零售动态配置文件。
[edit]
user@host# edit dynamic-profiles Subscriber_Profile_Retail1
- 在动态配置文件中定义动态路由实例变量。
[edit dynamic-profiles Subscriber_Profile_Retail1]
user@host# edit routing-instances $junos-routing-instance
- 设置动态路由实例的动态接口变量。
[edit dynamic-profiles Subscriber_Profile_Retail1 routing-instances “$junos-routing-instance”]
user@host# set interface $junos-interface-name
- 为动态配置文件定义动态接口变量。
[edit dynamic-profiles Subscriber_Profile_Retail1]
user@host# edit interfaces $junos-interface-ifd-name
- 为动态配置文件定义动态接口单元变量。
[edit dynamic-profiles Subscriber_Profile_Retail1 interfaces “$junos-interface-ifd-name”]
user@host# edit unit $junos-interface-unit
- (可选)为动态接口定义 VLAN 封装。
[edit dynamic-profiles Subscriber_Profile_Retail1 interfaces “$junos-interface-ifd-name” unit “$junos-interface-unit”]
user@host# set encapsulation vlan-vpls
注意:
如果选择不为逻辑接口指定封装,那么必须为物理接口指定封装。
- 定义动态配置文件的 VLAN 标记参数:
[edit dynamic-profiles Subscriber_Profile_Retail1 interfaces “$junos-interface-ifd-name” unit “$junos-interface-unit”]
user@host# set vlan-tags outer "$junos-stacked-vlan-id" inner "$junos-vlan-id"
- 定义输入和输出 VLAN 映射。有关详细信息,请参阅第 2 层批发解决方案的 VLAN 标记堆叠和重写 。在我们的示例中,我们使用:
[edit dynamic-profiles Subscriber_Profile_Retail1 interfaces “$junos-interface-ifd-name” unit “$junos-interface-unit”]
user@host# set input-vlan-map swap-push
user@host# set input-vlan-map vlan-id "$junos-vlan-map-id"
user@host# set input-vlan-map inner-vlan-id "$junos-inner-vlan-map-id"
user@host# set output-vlan-map pop-swap
user@host# set output-vlan-map inner-tag-protocol-id 0x8100
- 在
[edit dynamic-profiles profile-name interfaces “$junos-interface-ifd-name” unit “$junos-interface-unit” family]
层次结构级别上vpls
指定单元族。
[edit dynamic-profiles Subscriber_Profile_Retail1 interfaces “$junos-interface-ifd-name” unit “$junos-interface-unit”]
user@host# set family vpls
结果是一个动态订阅者配置文件,该配置文件使用 RADIUS 身份验证动态分配外部 VLAN ID。
动态配置文件以大括号格式显示:
[edit]
user@host# show dynamic-profiles
Subscriber_Profile_Retail1
routing-instances {
"$junos-routing-instance" {
interface "$junos-interface-name";
}
}
interfaces {
"$junos-interface-ifd-name" {
unit "$junos-interface-unit" {
encapsulation vlan-vpls;
vlan-tags outer "$junos-stacked-vlan-id" inner "$junos-vlan-id";
input-vlan-map {
swap-push;
vlan-id "$junos-vlan-map-id";
inner-vlan-id "$junos-inner-vlan-map-id";
}
output-vlan-map {
pop-swap;
inner-tag-protocol-id 0x8100;
}
family vpls;
}
}
}
通过 RADIUS 对 VLAN 进行身份验证的需求由 "$junos-vlan-map-id"
和 "$junos-vlan-id"
参数指定。
RADIUS 服务器将外部 VLAN ID 作为用户名属性的一部分返回,如下所示:
Type: VLAN
User Name: user1.xe-0/1/0:2015
Logical System: default
Routing Instance: ISP02-Test
Interface: xe-0/1/0.3221225509
Interface type: Dynamic
Underlying Interface: xe-0/1/0
Core IFL Name: xe-0/1/3.0
Dynamic Profile Name: Subscriber_Profile_Retail1
Dynamic Profile Version: 1
State: Active
Radius Accounting ID: 43
Session ID: 43
PFE Flow ID: 87
VLAN Id: 2015
VLAN Map Id: 100
Inner VLAN Map Id: 201
Login Time: 2021-07-07 06:42:33 PDT
Dynamic configuration:
junos-vlan-map-id: 100