配置 PPPoE 用户会话的锁定
您可以将路由器配置为暂时锁定失败或短期的 PPPoE 订阅者会话,使其无法重新连接一段时间。PPPoE 用户会话可驻留在 VLAN、VLAN 多路分离或 PPPoE-over-ATM 底层接口上。
开始之前:
配置 PPPoE 底层接口。
要配置底层接口以与 PPPoE 动态配置文件配合使用,请参阅 为动态 PPPoE 用户接口配置底层接口。
要为底层接口配置 PPPoE 家族,请参阅 为底层接口配置 PPPoE 家族。
要配置 PPPoE 用户会话的临时锁定:
- 指定要在底层接口上配置特定于 PPPoE 的选项:
对于 VLAN 多路分离 (demux) 逻辑接口动态配置文件中的 PPPoE 家族:
[edit dynamic-profiles profile-name interfaces demux0 unit logical-unit-number] user@host# edit family pppoe
对于动态配置文件中的 PPPoE 系列:
[edit dynamic-profiles profile-name interfaces interface-name unit logical-unit-number] user@host# edit family pppoe
对于动态配置文件中的 PPPoE 底层接口:
[edit dynamic-profiles profile-name interfaces interface-name unit logical-unit-number] user@host# edit pppoe-underlying-options
对于底层接口上的 PPPoE 系列:
[edit interfaces interface-name unit logical-unit-number] user@host# edit family pppoe
对于采用 PPPoE 封装的底层接口:
[edit interfaces interface-name unit logical-unit-number] user@host# edit pppoe-underlying-options
对于 PPPoE-over-ATM 逻辑接口动态配置文件中的 PPPoE 家族:
[edit dynamic-profiles profile-name interfaces at-fpc/pic/port unit logical-unit-number] user@host# edit family pppoe
对于底层 ATM 逻辑接口上的 PPPoE 家族:
[edit interfaces at-fpc/pic/port unit logical-unit-number] user@host# edit family pppoe
- 当具有相同媒体访问控制 (MAC) 源地址的 PPPoE 客户端会话已在该接口上处于活动状态时,启用重复保护以防止在同一底层接口上协商动态或静态 PPPoE 客户端会话。
[edit interfaces interface-name unit logical-unit-number pppoe-underlying-options] user@host# set duplicate-protection
最佳实践:配置 PPPoE 用户会话锁定时,建议启用重复保护,以确保每个 PPPoE 会话的 MAC 源地址在底层接口上都是唯一的。
- 使用以下过滤机制之一启用 PPPoE 用户会话锁定,以识别要锁定的用户会话:
基于媒体访问控制 (MAC) 地址的用户会话锁定(默认)
要将默认锁定周期为 1 到 300 秒的基于 MAC 的用户会话锁定配置:
[edit interfaces interface-name unit logical-unit-number pppoe-underlying-options] user@host# set short-cycle-protection
要使用非默认锁定期配置基于 MAC 的用户会话锁定:
[edit interfaces interface-name unit logical-unit-number pppoe-underlying-options] user@host# set short-cycle-protection lockout-time-min minimum-seconds lockout-time-max maximum-seconds
基于代理电路标识符 (ACI) 的用户会话锁定
要使用默认锁定期配置基于 ACI 的用户会话锁定:
[edit interfaces interface-name unit logical-unit-number pppoe-underlying-options] user@host# set short-cycle-protection filter aci
例如,以下语句根据 ACI 信息为动态 VLAN 多路分离底层接口上的用户会话配置临时锁定。它使用默认的锁定时间范围 1 到 300 秒。
[edit dynamic-profiles my-demux-vlan-profile interfaces demux0 unit “$junos-interface-unit” family pppoe] user@host# set short-cycle-protection filter aci
要使用非默认锁定期配置基于 ACI 的用户会话锁定:
[edit interfaces interface-name unit logical-unit-number pppoe-underlying-options] user@host# set short-cycle-protection lockout-time-min minimum-seconds lockout-time-max maximum-seconds filter aci
例如,以下语句根据 ACI 信息为动态 VLAN 底层接口上的用户会话配置临时锁定。它指定 20 到 120 秒范围内的非默认锁定时间。
[edit dynamic-profiles my-vlan-profile interfaces “$junos-interface-ifd-name” unit “$junos-interface-unit” pppoe-underlying options] user@host# set short-cycle-protection lockout-time-min 20 lockout-time-max 120 filter aci
注意:如果在配置基于 ACI 的用户会话锁定时,PPPoE 属性中没有 ACI 值,则路由器默认使用基于 MAC 的锁定。使用基于 ACI 的封装类型锁定,没有 ACI 属性的 PPPoE 客户端也会被锁定。