PC lient典型配置举例
组网需求
Host运行PPPoE Client,通过设备Router接入到Internet。设备作为PPPoE Server,配置本地认证,并通过地址池为用户分配IP地址。设备Router通过Ethernet1/1接口连接以太网,Serial2/0接口连接Internet
增加一个PPPoE用户。
system-view
[H3C-Router] local-user user1 class network
[H3C-Router-luser-user1] password simple pass1
[H3C-Router-luser-user1] service-type ppp
[H3C-Router-luser-user1] quit
# 在设备Router上配置虚拟模板参数。
[H3C-Router] interface virtual-template 1
[H3C-Router-Virtual-Template1] ppp authentication-mode chap domain system
[H3C-Router-Virtual-Template1] ppp chap user user1
[H3C-Router-Virtual-Template1] remote address pool 1
[H3C-Router-Virtual-Template1] ip address 1.1.1.1 255.0.0.0
[H3C-Router-Virtual-Template1] quit
# 在设备Router上配置PPPoE参数。
[H3C-Router] interface ethernet 1/1
[H3C-Router-Ethernet1/1] pppoe-server bind virtual-template 1
[H3C-Router-Ethernet1/1] quit
# 配置域用户使用本地认证方案。
[H3C-Router] domain system
[H3C-Router-isp-system] authentication ppp local
# 增加一个本地IP地址池(9个IP地址)
[H3C-Router-isp-system] ip pool 1 1.1.1.2 1.1.1.10
这样,以太网上各主机安装PPPoE客户端软件后,配置好用户名和密码(此处为user1和pass1)就能使用PPPoE协议,通过设备Router接入到Internet。
PPPoE Server与Client典型配置举例
组网需求
Router A和Router B之间通过各自的Ethernet1/1接口相连,要求Router A用PAP/CHAP方式验证Router B
方案一:PAP认证
(1)配置Router A作为PPPoE Server
# 增加一个PPPoE用户。
system-view
[H3C-RouterA] local-user user2
[H3C-RouterA-luser-user2] password simple hello
[H3C-RouterA-luser-user2] service-type ppp
[H3C-RouterA-luser-user2] quit
# 配置虚拟模板参数。
[H3C-RouterA] interface virtual-template 1
[H3C-RouterA-Virtual-Template1] ppp authentication-mode pap
[H3C-RouterA-Virtual-Template1] ip address 1.1.1.1 255.0.0.0
[H3C-RouterA-Virtual-Template1] remote address 1.1.1.2
[H3C-RouterA-Virtual-Template1] quit
# 调用到接口
[H3C-RouterA] interface ethernet 1/1
[H3C-RouterA-Ethernet1/1] pppoe-server bind virtual-template 1
(2)配置Router B作为PPPoE Client
system-view
[H3C-RouterB] dialer-rule 1 ip permit
[H3C-RouterB] interface dialer 1
[H3C-RouterB-Dialer1] dialer user user2
[H3C-RouterB-Dialer1] dialer-group 1
[H3C-RouterB-Dialer1] dialer bundle 1
[H3C-RouterB-Dialer1] ip address ppp-negotiate
[H3C-RouterB-Dialer1] ppp pap local-user user2 password simple hello
[H3C-RouterB-Dialer1] quit
# 配置PPPoE会话。
[H3C-RouterB] interface ethernet 1/1
[H3C-RouterB-Ethernet1/1] pppoe-client dial-bundle-number 1
方案二:CHAP认证
(1)配置Router A作为PPPoE Server
# 增加一个PPPoE用户。
system-view
[H3C-RouterA] local-user user2
[H3C-RouterA-luser-user2] password simple hello
[H3C-RouterA-luser-user2] service-type ppp
[H3C-RouterA-luser-user2] quit
# 配置虚拟模板参数。
[H3C-RouterA] interface virtual-template 1
[H3C-RouterA-Virtual-Template1] ppp authentication-mode chap
[H3C-RouterA-Virtual-Template1] ppp chap user user1
[H3C-RouterA-Virtual-Template1] ip address 1.1.1.1 255.0.0.0
[H3C-RouterA-Virtual-Template1] remote address 1.1.1.2
[H3C-RouterA-Virtual-Template1] quit
# 配置PPPoE Server。
[H3C-RouterA] interface ethernet 1/1
[H3C-RouterA-Ethernet1/1] pppoe-server bind virtual-template 1
(2)配置Router B作为PPPoE Client
system-view
[H3C-RouterB] dialer-rule 1 ip permit
[H3C-RouterB] interface dialer 1
[H3C-RouterB-Dialer1] dialer user user2
[H3C-RouterB-Dialer1] dialer-group 1
[H3C-RouterB-Dialer1] dialer bundle 1
[H3C-RouterB-Dialer1] ip address ppp-negotiate
[H3C-RouterB-Dialer1] ppp chap user user2
[H3C-RouterB-Dialer1] ppp chap password cipher hello
[H3C-RouterB-Dialer1] quit
# 配置PPPoE会话。
[H3C-RouterB] interface ethernet 1/1
[H3C-RouterB-Ethernet1/1] pppoe-client dial-bundle-number 1
实际建议配置
[H3C-RouterB] interface dialer 1
[H3C-RouterB-Dialer1] dialer user user2
[H3C-RouterB-Dialer1] dialer-group 1
[H3C-RouterB-Dialer1] dialer bundle 1
[H3C-RouterB-Dialer1] ip address ppp-negotiate
[H3C-RouterB-Dialer1] ppp chap user user2
[H3C-RouterB-Dialer1] ppp chap password cipher hello
[H3C-RouterB-Dialer1] ppp pap local-user user2 password simple hello
[H3C-RouterB-Dialer1] mtu 1492
[H3C-RouterB-Dialer1]tcp adjust-mss 1400
[H3C-RouterB-Dialer1] quit
[H3C-RouterB] interface ethernet 1/1
[H3C-RouterB-Ethernet1/1] pppoe-client dial-bundle-number 1
实际配置可能不知道运营商是用CHAP还是PAP认证,所以这里把PAP把CHAP的方式都配置上,这个肯定是没问题的,另外MTU与TCP adjust-mss一定要配置,为什么要配置下面有说明。
容易遇到的问题
(1)一些网站或者应用打开慢以及打不开的情况,这个很有可能是MTU与TCP MSS导致,可以多尝试几个值来达到比较理想的效果。
Router-pppoe_client(config)#interface dialer 1
Router-pppoe_client(config-if)# mtu 1492 //范围建议在1000~1492之间
Router-pppoe_client(config-if)# tcp adjust-mss 1400 //范围在1000~1452之间
(2)一些小企业或者SOHO级别的网络可能申请的是民用的拨号线路,那这个时候有可能自己用电脑先拨入测试效果,然后发现在路由器上面怎么都拨入不了,那很有可能是运营商那边绑定了,需要打电话过去松绑。
(3)ADSL有可能采用私网地址分配,所以在申请的时候需要考虑是否需要做映射服务出去或者一些VPN拨入,在申请的时候需要跟对方说明清楚。(包括80端口是否可以用)