實驗2-2 配置PPPoE客戶端
學習目標
掌握PPPoE客戶端撥號接口的配置方法
掌握PPPoE客戶端認證的配置方法
拓撲圖
場景
企業在運營商開通了高速DSL服務用於支持廣域網業務,R1和R3分別十企業分支的邊緣路由器,他們通過PPPoE服務器(R2)連接到運營商網絡。您需要在企業的邊緣路由器上進行PPPoE客戶端的配置,讓局域網中的主機可以通過PPPoE撥號訪問外部資源。
操作步驟
步驟一 實驗環境準備
步驟二 配置PPPoE服務器
雖然PPPoE服務器不在企業網絡中,但是本實驗中仍需要配置PPPoE服務器,以用於認證企業網絡的邊緣路由器R1和R3.
R2
[R2]ip pool pool1
Info: It's successful to create an IP address pool.
[R2-ip-pool-pool1]network 119.84.111.0 mask 255.255.255.0
[R2-ip-pool-pool1]gateway-list 119.84.111.254
[R2-ip-pool-pool1]quit
[R2]interface Virtual-Template 1
[R2-Virtual-Template1]ppp authentication-mode chap
[R2-Virtual-Template1]ip add 119.84.111.254 255.255.255.0
[R2-Virtual-Template1]remote address pool pool1
[R2-Virtual-Template1]quit
在R2的G 0/0/0接口綁定虛擬模板
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]pppoe-server bind virtual-template 1
[R2-GigabitEthernet0/0/0]quit
爲PPPoE被認證方創建合法的賬號密碼
[R2]aaa
[R2-aaa]local-user huawei1 password cipher huawei123
Info: Add a new user.
[R2-aaa]local-user huawei1 service-type ppp
[R2-aaa]local-user huawei2 password cipher huawei123
Info: Add a new user.
[R2-aaa]local-user huawei2 service-type ppp
[R2-aaa]quit
步驟三 配置PPPoE客戶端
將R1配置成PPPoE客戶端,需要在R1上創建撥號接口並開啓PPP認證功能。配置PPP被認證方的用戶名和密碼(必須和PPPoE服務器上一致)
[R1]dialer-rule
[R1-dialer-rule]dialer-rule 1 ip permit
[R1-dialer-rule]quit
[R1]interface dialer 1
[R1-Dialer1]dialer user user1
[R1-Dialer1]dialer-group 1
[R1-Dialer1]dialer bundle 1
[R1-Dialer1]ppp chap user huawei1
[R1-Dialer1]ppp chap password cipher huawei123
[R1-Dialer1]dialer timer idle 300
INFO: The configuration will become effective after link reset.
[R1-Dialer1]dialer queue-length 8
[R1-Dialer1]ip address ppp-negotiate
[R1-Dialer1]quit
將PPPoE撥號接口綁定到出接口
[R1]interface g 0/0/0
[R1-GigabitEthernet0/0/0]pppoe-client dial-bundle-number 1
[R1-GigabitEthernet0/0/0]quit
配置本端到PPPoE服務器的缺省靜態路由
[R1]ip route-static 0.0.0.0 0.0.0.0 dialer 1
將R3配置爲PPPoE客戶端,配置步驟同R1
改動之處在於
[R1-Dialer1]ppp chap user huawei1
步驟四 驗證配置結果
執行 display pppoe-server session all命令,查看PPPoE會話的狀態和配置信息
<R2>display pppoe-server session all
SID Intf State OIntf RemMAC LocMAC
1 Virtual-Template1:0 UPGE0/0/000e0.fcd7.18f2 00e0.fc01.6244
2 Virtual-Template1:1 UPGE0/0/000e0.fc8c.5146 00e0.fc01.6244
<R2>
查看R1和R3上的撥號接口的信息,並確認撥號接口能夠從PPPoE服務器獲取IP地址
R1
<R1>display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 3
Interface IP Address/Mask Physical Protocol
Dialer1 119.84.111.253/32up up(s)
GigabitEthernet0/0/0 unassigned up down
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
R3
[R3]dis ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 3
Interface IP Address/Mask Physical Protocol
Dialer1 119.84.111.252/32up up(s)
GigabitEthernet0/0/0 unassigned up down
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)