首页 / 配置案例 / 迈普 MP2900X 配置 PPPoE 拨号上网
适用型号:MP2900X 系列多业务路由器(手册版本 8.11.0.95)
下面按【参考资料】给出 MP2900X 配置 PPPoE 拨号上网的完整可检索配置。资料中主要给出两类客户端拨号方式:常规拨号和自动拨号。若你是接入运营商/上级 PPPoE 服务器,通常只需要配置“PPPoE 客户端 + 默认路由”;若你是自建 PPPoE 服务器测试,则同时需要服务器端配置。
gigabitethernet0。实际请根据设备接口替换 [2][3]。dialer 接口和拨号池配置 [5]。dialer 接口 [5]。dialer-list 和 dialer-group [2]。pppoe-client auto-dial always [3]。常规拨号方式下,PPPoE 会话由流量触发建立。资料示例中使用 dialer0 作为拨号接口,使用 gigabitethernet0 作为物理 PPPoE 外网接口 [2]。
Device1#configure terminal
Device1(config)#dialer-list 1 protocol ip permit
该命令创建拨号列表 1,允许 IP 流量触发拨号 [2]。
Device1(config)#interface dialer0
Device1(config-if-dialer0)#ip address negotiated
Device1(config-if-dialer0)#dialer in-band
Device1(config-if-dialer0)#dialer pool 1
Device1(config-if-dialer0)#dialer-group 1
Device1(config-if-dialer0)#exit
说明:
ip address negotiated:表示 Dialer0 的 IP 地址由 PPPoE 服务器协商分配 [2]。dialer in-band:启用带内拨号 [2]。dialer pool 1:将 Dialer0 关联到拨号池 1 [2]。dialer-group 1:将 Dialer0 关联到拨号列表 1,用于触发拨号 [2]。Device1(config)#interface gigabitethernet0
Device1(config-if-gigabitethernet0)#pppoe-client dial-pool-number 1
Device1(config-if-gigabitethernet0)#exit
该命令将 gigabitethernet0 配置为 PPPoE 客户端拨号接口,并加入拨号池 1 [2]。
命令格式中还支持可选的 ac-name 参数:
pppoe-client dial-pool-number dial-pool-number [ ac-name ac-name ]
如果局端/运营商指定了接入集中器名称,可以按该格式添加 ac-name [5]。
如果拨号成功后需要访问互联网或非直连网络,需要配置出接口为 dialer0 的默认路由:
Device1(config)#ip route 0.0.0.0 0.0.0.0 dialer0
资料中明确给出该默认路由配置 [1]。
Device1#configure terminal
Device1(config)#dialer-list 1 protocol ip permit
Device1(config)#interface dialer0
Device1(config-if-dialer0)#ip address negotiated
Device1(config-if-dialer0)#dialer in-band
Device1(config-if-dialer0)#dialer pool 1
Device1(config-if-dialer0)#dialer-group 1
Device1(config-if-dialer0)#exit
Device1(config)#interface gigabitethernet0
Device1(config-if-gigabitethernet0)#pppoe-client dial-pool-number 1
Device1(config-if-gigabitethernet0)#exit
Device1(config)#ip route 0.0.0.0 0.0.0.0 dialer0
以上为资料中给出的 PPPoE 常规拨号客户端完整配置 [2][1]。
如果希望 PPPoE 客户端自动拨号,而不是等待流量触发,可以使用自动拨号方式 [3]。
Device1#configure terminal
Device1(config)#interface dialer0
Device1(config-if-dialer0)#ip address negotiated
Device1(config-if-dialer0)#dialer in-band
Device1(config-if-dialer0)#dialer pool 1
Device1(config-if-dialer0)#exit
说明:
ip address negotiated:IP 地址由 PPPoE 服务器分配 [3]。dialer pool 1:Dialer0 关联拨号池 1 [3]。Device1(config)#interface gigabitethernet0
Device1(config-if-gigabitethernet0)#pppoe-client dial-pool-number 1
Device1(config-if-gigabitethernet0)#pppoe-client auto-dial always
Device1(config-if-gigabitethernet0)#exit
说明:
pppoe-client dial-pool-number 1:将物理接口加入拨号池 1 [3]。pppoe-client auto-dial always:配置 PPPoE 自动拨号 [3]。资料中自动拨号客户端示例未单独列出默认路由,但如果拨号后需要访问互联网,可参考常规拨号示例配置默认路由:
Device1(config)#ip route 0.0.0.0 0.0.0.0 dialer0
默认路由出接口为 dialer0 [1]。
Device1#configure terminal
Device1(config)#interface dialer0
Device1(config-if-dialer0)#ip address negotiated
Device1(config-if-dialer0)#dialer in-band
Device1(config-if-dialer0)#dialer pool 1
Device1(config-if-dialer0)#exit
Device1(config)#interface gigabitethernet0
Device1(config-if-gigabitethernet0)#pppoe-client dial-pool-number 1
Device1(config-if-gigabitethernet0)#pppoe-client auto-dial always
Device1(config-if-gigabitethernet0)#exit
Device1(config)#ip route 0.0.0.0 0.0.0.0 dialer0
其中自动拨号关键命令是 pppoe-client auto-dial always [3]。
如果你不是接入运营商,而是使用一台 MP2900X 作为 PPPoE 服务器,资料中也给出了服务器端配置示例 [2][4][6]。
以下示例中:
Device2 为 PPPoE 服务器。Loopback0 地址为 172.16.20.1/32。172.16.20.10 到 172.16.20.100。virtual-template 0。gigabitethernet0 上启用 PPPoE 服务。Device2#configure terminal
Device2(config)#interface loopback0
Device2(config-if-loopback0)#ip address 172.16.20.1 255.255.255.255
Device2(config-if-loopback0)#exit
该地址用于作为 PPPoE 服务器端地址参考 [2]。
Device2(config)#ip local pool pppoe-pool 172.16.20.10 172.16.20.100
该地址池用于给 PPPoE 客户端分配 IP 地址 [2]。
Device2(config)#interface virtual-template 0
Device2(config-if-virtual-template0)#ip unnumbered loopback0
Device2(config-if-virtual-template0)#encapsulation ppp
Device2(config-if-virtual-template0)#peer default ip address pool pppoe-pool
Device2(config-if-virtual-template0)#exit
说明:
ip unnumbered loopback0:Virtual-Template0 借用 Loopback0 的 IP 地址。encapsulation ppp:封装 PPP。peer default ip address pool pppoe-pool:使用地址池 pppoe-pool 给客户端分配地址。以上配置来自资料中的服务器端示例 [2][6]。
Device2(config)#vpdn enable
Device2(config)#vpdn-group maipu
Device2(config-vpdn)#accept-dialin
Device2(config-vpdn-acc-in)#protocol pppoe
Device2(config-vpdn-acc-in)#virtual-template 0
Device2(config-vpdn)#exit
说明:
vpdn enable:启用 VPDN。vpdn-group maipu:创建 VPDN 组。accept-dialin:允许拨入。protocol pppoe:接受 PPPoE 协议。virtual-template 0:使用虚拟模板 0。以上配置来自资料 [4][6]。
Device2(config)#interface gigabitethernet0
Device2(config-if-gigabitethernet0)#pppoe enable
Device2(config-if-gigabitethernet0)#exit
该命令在服务器端接口上启用 PPPoE 服务 [4][6]。
Device2#configure terminal
Device2(config)#interface loopback0
Device2(config-if-loopback0)#ip address 172.16.20.1 255.255.255.255
Device2(config-if-loopback0)#exit
Device2(config)#ip local pool pppoe-pool 172.16.20.10 172.16.20.100
Device2(config)#interface virtual-template 0
Device2(config-if-virtual-template0)#ip unnumbered loopback0
Device2(config-if-virtual-template0)#encapsulation ppp
Device2(config-if-virtual-template0)#peer default ip address pool pppoe-pool
Device2(config-if-virtual-template0)#exit
Device2(config)#vpdn enable
Device2(config)#vpdn-group maipu
Device2(config-vpdn)#accept-dialin
Device2(config-vpdn-acc-in)#protocol pppoe
Device2(config-vpdn-acc-in)#virtual-template 0
Device2(config-vpdn)#exit
Device2(config)#interface gigabitethernet0
Device2(config-if-gigabitethernet0)#pppoe enable
Device2(config-if-gigabitethernet0)#exit
以上为资料中 PPPoE 服务器端配置 [2][4][6]。
在 PPPoE 客户端执行:
Device1#show int dialer 0
资料中给出的正常结果示例包括:
dialer0:
line protocol is up
Flags: (0xc0080f1) POINT-TO-POINT MULTICAST RUNNING
Type: PPP
Internet address: 172.16.20.10/32
Destination Internet address: 172.16.20.1
重点关注:
line protocol is upType: PPPInternet address 是否已经获取到地址Destination Internet address 是否为服务器端地址以上验证信息来自资料 [4][6]。
对于常规拨号,资料中说明可以在客户端 ping 一个目的地址来触发 PPPoE 拨号,例如:
Device1#ping 1.1.1.1
然后再查看:
Device1#show int dialer 0
如果 dialer0 状态变为 line protocol is up 并获取到地址,说明 PPPoE 拨号建立成功 [6]。
以下排查点均来自资料中的配置关系。
dialer0 未 up 或未获取地址检查:
show int dialer 0
如果 line protocol 未 up,或未看到 Internet address,需要检查:
interface gigabitethernet0
pppoe-client dial-pool-number 1
dialer0 是否配置了同一个拨号池:interface dialer0
dialer pool 1
因为每个 PPPoE 会话唯一对应一个拨号池,每个拨号池又唯一对应一个 dialer 接口 [5]。
常规拨号需要触发流量,并且需要配置:
dialer-list 1 protocol ip permit
interface dialer0
dialer-group 1
如果缺少 dialer-list 或 dialer-group,可能导致 IP 流量无法触发拨号 [2]。
同时资料中说明可以通过 ping 触发拨号 [6]。
如果使用自动拨号,需要确认物理接口下是否有:
pppoe-client auto-dial always
这是资料中自动拨号的关键命令 [3]。
如果是自建 PPPoE 服务器,需要检查服务器端是否完成以下配置:
vpdn enable
vpdn-group maipu
accept-dialin
protocol pppoe
virtual-template 0
以及外网接口是否启用 PPPoE:
interface gigabitethernet0
pppoe enable
这些是资料中服务器端必要配置 [4][6]。
gigabitethernet0,实际环境中请替换为真实外网接口,例如 gigabitethernet0/1、fastethernet0 等,具体以设备实际接口为准 [2][3]。dialer 接口和拨号池配置 [5]。dialer 接口,不要多个会话错误共用同一拨号池 [5]。dialer-list 和 dialer-group,由流量触发拨号 [2]。pppoe-client auto-dial always [3]。dialer0 [1]。【参考出处】
[1] MP2900X系列产品配置手册(8.11.0.95(R)-20211030) (2).md / IP Network1与IP Network2可以
更多配置问题可进入 BOOKRAG 控制台 选择对应型号直接提问,回答基于该型号官方手册原文。