FortiGate-v5.2-PPPOE 拨号协商时的 AC-name 和 Service-name 版本 1.0 时间 2015 年 3 月 支持的版本 FortiOS v5.2.x 作者 黄豪赫 状态 已审核 反馈 support_cn@fortinet.com 1
目 录 简介...3 PPPoE 发现阶段简介...3 相关组件...4 参考文档...4 FortiGate 相关命令介绍... 4 测试拓扑图...4 测试过程...5 2
简介 在互联网络世界里, 电信运营商采用 PPPoE 协议为个人用户提供的宽带接入方式,PPPoE 是在以太网上承载 PPP 协议 ( 点到点连接协议 ), 它利用以太网将大量主机组成网络, 通过一个宽带接入服务器 (roadband Remote Access Server, 简称 BRAS) 连入因特网, 并对接入的每一个主机实现控制 计费功能 PPPoE 主要分为两个阶段, 发现 (Discovery) 阶段和会话 (session) 阶段, 本文主要介绍 PPPoE 发现阶段的 AC-name 和 Service-name 参数协商 PPPoE 发现阶段简介 Discovery 阶段由四个过程组成 完成之后通信双方都会知道 PPPoE 的 Session_ID 以及对方以太网地址, 它们共同确定了唯一的 PPPoE Session (1) PPPoE Client 广播发送一个 PADI 报文, 在此报文中包含 PPPoE Client 想要得到的服务类型信息 (2) 所有的 PPPoE Server 收到 PADI 报文之后, 将其中请求的服务与自己能够提供的服务进行比较, 如果可以提供, 则单播回复一个 PADO 报文 (3) 根据网络的拓扑结构,PPPoE Client 可能收到多个 PPPoE Server 发送的 PADO 报文,PPPoE Client 选择最先收到的 PADO 报文对应的 PPPoE Server 做为自己的 PPPoE Server, 并单播发送一个 PADR 报文 (4) PPPoE Server 产生一个唯一的会话 ID(SESSION ID), 标识和 PPPoE Client 的这个会话, 通过发送一个 PADS 报文把会话 ID 发送给 PPPoE Client, 如果没有错误, 会话建立后便进入 PPPoE Session 阶段 在 PPPoE 的 discovery 阶段, 主要是与发现和选择 PPPoE Server 接入服务器 在此过程中,PPPoE Server 接入服务器和 PPPoE 拨号客户端会协商 AC-name 和 service-name, 如果出现不匹配时, 无法正常拨号 FortiOS v5.2.x 以上版本, 支持在拨号端口设置 ac-name 和 service-name 3
相关组件 FortiGate 防火墙 参考文档 FortiOS CLI Reference FortiGate 相关命令介绍 配置命令 : edit port1 set mode pppoe set service-name <name> // 配置 service-name// set ac-name <name> end // 配置 ac-name// 测试拓扑图 1. FW1 作为 PPPoE 拨号的客户端 2. FW1 通过以太网连接到两台 PPPoE Server, 分别为 BRAS1 和 BRAS2 4
3. BRAS1 的 ip pool 为 40.1.1.100-253 AC-name fortinet1 和 BRAS2 的 ip pool 为 50.1.1.100-253 fortinet2 4. 当 FW1 设置 AC-name 为 fortinet2 时, 仅能和 BRAS2 建立 PPPoE 会话 5. 当 BRAS2 中断时,FW1 和 BRAS1 由于 AC-name 不匹配, 无法正常拨号 测试过程 1.BRAS1 和 BRAS2 的配置如下 : BRAS1 的配置 : hostname BRAS1 vpdn enable username fortinet password 0 fortinet aaa new-model aaa authentication ppp default local bba-group pppoe global virtual-template 1 ac name fortinet1 interface Loopback0 ip address 200.1.1.254 255.255.255.0 interface FastEthernet0/0 mac-address ca00.3b44.0001 no ip address duplex half pppoe enable group global interface Virtual-Template1 mtu 1492 ip address 40.1.1.254 255.255.255.0 peer default ip address pool pppoe keepalive 5 ppp authentication chap callin ppp ipcp dns 8.8.8.8 5
ip local pool pppoe 40.1.1.100 40.1.1.253 BRAS2 的配置 : aaa new-model aaa authentication ppp default local vpdn enable username fortinet password 0 fortinet bba-group pppoe global virtual-template 1 ac name fortinet2 interface Loopback0 ip address 200.2.2.254 255.255.255.0 interface FastEthernet0/0 mac-address ca00.3b44.0002 no ip address shutdown duplex half pppoe enable group global interface Virtual-Template1 mtu 1492 ip address 50.1.1.254 255.255.255.0 peer default ip address pool pppoe keepalive 5 ppp authentication chap callin ppp ipcp dns 8.8.8.8 ip local pool pppoe 50.1.1.100 50.1.1.253 2. 在 FW1 上配置 AC-name 为 fortinet1,service-name 为 BRAS, 拨号时, BRAS1 和 BRAS2 均向应 FW1 的 PADI 包, 但 FW1 选择了 BRAS2 建立连接 FW1 配置如下 : edit "port2" set vdom "root" set mode pppoe set type physical set snmp-index 2 set username "fortinet" 6
set password ENC BMc6GrB64XJnAx3/YVWsyv8kw0qnB6dXetQF+d2D/O6YSR6SR2UIG8TwPX+5qBynV6gC v1vocez5bhohus8mgysgz7rmds1+97zz8cyetraxywobbqqq5nfai/wazngkbkmjcykno d4tkpoanncqfardzcrp1wdso+wjwxxsuc9n/yvrxm2mng55oqkkw4fahhsiqa== set service-name "BRAS" set ac-name "fortinet2" set auth-type chapl FW1 选择了 BRAS2 建立连接, 如下所示 : FW1 # get router info routing-table all Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default S* 0.0.0.0/0 [5/0] via 50.1.1.254, ppp0 S C C 50.1.1.100// C 20.1.0.0/16 [10/0] is a summary, Null 30.1.1.0/24 is directly connected, Loopback1 50.1.1.100/32 is directly connected, ppp0 // 接入 BRAS2, 分配的 IP 为 50.1.1.254/32 is directly connected, ppp0 C 192.168.0.0/24 is directly connected, port1 从抓包中能看出,FW1 发送 PADI 的报文,BRAS1 和 BRAS2 分别回应 PADR 报文响应, 并且携带自已的 AC-name FW1 检查到 BRAS2 的 ac-name 匹配, 回应 PADS 报文 3. 当 BRAS2 中断时,FW1 与 BRAS1 无法进行正常拨号 从抓包看到,FW1 发送 AC-name 为 fortinet2, 而 BRAS1 的 AC-name 为 fortinet1, 协商失败 如下所示 : 7
8