华为eNSP:PPPoE客户端+服务器配置实验
一、实验概述
本实验基于华为eNSP平台,搭建了一个完整的PPPoE拨号场景,包含:
- 1台PPPoE服务器(AR2):负责用户认证、地址池分配
- 1台PPPoE客户端(AR1):负责拨号接入、内网NAT转换
- 1台PC:模拟内网用户,通过AR1访问公网
实验目标:
- 掌握PPPoE服务器端地址池、虚拟模板、AAA认证配置
- 掌握PPPoE客户端Dialer拨号接口、认证配置
- 结合Easy-IP NAT与默认路由,实现内网PC访问公网
二、实验拓扑

说明:PPPoE Server(AR2)GE0/0/0 连接AR1;PPPoE Client(AR1)GE0/0/0 连接AR2,GE0/0/1 连接PC(内网口)。
三、详细配置步骤
(一)配置PPPoE服务器(AR2)
1. 基础配置与地址池
<Huawei> system-view
[Huawei] sysname PPPoe_server
# 配置PPPoE客户端地址池
[PPPoe_server] ip pool pool1
[PPPoe_server-ip-pool-pool1] network 100.1.1.0 mask 24
[PPPoe_server-ip-pool-pool1] gateway-list 100.1.1.1
[PPPoe_server-ip-pool-pool1] quit
2. 配置 AAA 用户(CHAP 认证用)
shell
[PPPoe_server] aaa
[PPPoe_server-aaa] local-user huawei password cipher huawei
[PPPoe_server-aaa] local-user huawei service-type ppp
[PPPoe_server-aaa] quit
3. 配置虚拟模板 VT 接口
shell
[PPPoe_server] interface Virtual-Template 1
[PPPoe_server-Virtual-Template1] ip address 100.1.1.1 24
[PPPoe_server-Virtual-Template1] ppp authentication-mode chap
[PPPoe_server-Virtual-Template1] remote address pool pool1
[PPPoe_server-Virtual-Template1] quit
4. 物理接口绑定 PPPoE 服务
shell
[PPPoe_server] interface GigabitEthernet 0/0/0
[PPPoe_server-GigabitEthernet0/0/0] pppoe-server bind virtual-template 1
[PPPoe_server-GigabitEthernet0/0/0] quit
(二)配置 PPPoE 客户端(AR1)
1. 基础配置与 Dialer 拨号接口
shell
<Huawei> system-view
[Huawei] sysname PPPoe_client
# 配置Dialer 0接口(PPPoE拨号用)
[PPPoe_client] interface Dialer 0
[PPPoe_client-Dialer0] dialer user user1
[PPPoe_client-Dialer0] dialer bundle 1
[PPPoe_client-Dialer0] ppp chap user huawei
[PPPoe_client-Dialer0] ppp chap password cipher huawei
[PPPoe_client-Dialer0] ip address ppp-negotiate
[PPPoe_client-Dialer0] quit
2. 物理接口绑定 Dialer
shell
[PPPoe_client] interface GigabitEthernet 0/0/0
[PPPoe_client-GigabitEthernet0/0/0] pppoe-client dial-bundle-number 1
[PPPoe_client-GigabitEthernet0/0/0] quit
3. 配置内网接口
shell
[PPPoe_client] interface GigabitEthernet 0/0/1
[PPPoe_client-GigabitEthernet0/0/1] ip address 10.1.1.2 24
[PPPoe_client-GigabitEthernet0/0/1] quit
4. 配置 Easy-IP NAT 与默认路由
shell
# 配置ACL,定义需要转换的内网流量
[PPPoe_client] acl 2000
[PPPoe_client-acl-basic-2000] rule permit source 10.1.1.0 0.0.0.255
[PPPoe_client-acl-basic-2000] quit
# 在Dialer接口配置NAT
[PPPoe_client] interface Dialer 0
[PPPoe_client-Dialer0] nat outbound 2000
[PPPoe_client-Dialer0] quit
# 配置默认路由,所有流量走Dialer 0接口
[PPPoe_client] ip route-static 0.0.0.0 0 Dialer 0
四、实验结果验证
1. 客户端拨号状态验证
shell
[PPPoe_client] display ip interface brief
输出关键信息:
plaintext
Dialer0 100.1.1.254/32 up up(s)
GE0/0/1 10.1.1.2/24 up up
2. 客户端与服务器连通性验证
shell
[PPPoe_client] ping 100.1.1.1
输出:
plaintext
Reply from 100.1.1.1: bytes=56 Sequence=1 ttl=255 time=80 ms
Reply from 100.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 100.1.1.1: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 100.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 100.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms
3. 内网 PC 访问公网验证
PC 配置:
IP:10.1.1.3
子网掩码:255.255.255.0
网关:10.1.1.2
在 PC 上 ping 服务器端地址:
plaintext
PC> ping 100.1.1.1
五、常见问题与排错
Dialer 接口协议 Down,无法获取 IP
检查两端 PPP 认证的用户名、密码是否一致
确认服务器端 VT 接口已绑定地址池,且地址池网段无冲突
检查物理接口是否已绑定 Dialer Bundle
PC 无法访问公网
检查 PC 的网关是否指向 AR1 的内网口 IP
确认 AR1 的默认路由已配置,下一跳为 Dialer 0
检查 NAT outbound 是否在 Dialer 接口正确配置,且 ACL 规则匹配内网网段
六、实验总结
PPPoE 技术通过在以太网链路上封装 PPP 协议,实现了用户认证、IP 地址动态分配,是宽带接入的主流技术。
服务器端的虚拟模板(VT)接口是 PPPoE 配置的核心,所有认证、地址分配规则都需要绑定到 VT 接口。
结合 Easy-IP NAT 与默认路由,可以实现内网用户通过 PPPoE 拨号共享公网 IP 访问互联网,是家庭宽带路由器的核心工作原理。
CHAP 认证相比 PAP 认证更安全,密码以哈希值形式传输,不会暴露明文,实际场景中推荐使用。
9362


&spm=1001.2101.3001.11974&articleId=161997909&d=1&t=3&u=2c724d40c3634f4b8b48df28e41d098c)

被折叠的 条评论
为什么被折叠?



