天天看點

ensp-PPPoE實驗

實驗拓撲如下:

ensp-PPPoE實驗

圖檔辨別錯誤:PPPoE伺服器的ip位址應該是202.100.1.2/24

AR1:

用戶端配置

[Huawei]sysname AR1
[AR1]dialer-rule      #進入dialer-rule視圖
[AR1-dialer-rule]dialer-rule 1 ip permit #允許ip流量觸發撥号
[AR1-dialer-rule]qu
[AR1]interface Dialer 1
May  1 2020 09:16:34-08:00 AR1 %%01IFPDT/4/IF_STATE(l)[0]:Interface Dialer1 has 
turned into UP state.
[AR1-Dialer1]link-protocol ppp     #協定設定為ppp
[AR1-Dialer1]ip address ppp-negotiate    #撥号接口位址從pppoe的伺服器寫上得到
[AR1-Dialer1]dialer user hcna   #hcna是一個辨別    
[AR1-Dialer1]dialer bundle 1    #指定dialer 1 接口的編号(用于和實體接口綁定)
[AR1-Dialer1]qu
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]pppoe-client dial-bundle-number 1  #将pppoe撥号接口綁定到出接口
[AR1-GigabitEthernet0/0/0]qu
[AR1]int Dialer 1
[AR1-Dialer1]ppp chap user hcnp   #采用chap認證
[AR1-Dialer1]ppp chap password cipher hcnp123   #賬号與密碼需要與ISP端設定的賬号密碼一緻
[AR1]ip route-static 0.0.0.0 0 202.100.1.2


[AR1]acl 2000                      #此處做一個nat位址轉換,讓内網位址通過撥号得到的位址上網
[AR1-acl-basic-2000]rule permit source any 
[AR1-acl-basic-2000]qu
[AR1]int Dialer 1
[AR1-Dialer1]nat outbound 2000
           

AR2:

服務端配置

<Huawei>system-view 
[Huawei]sysname AR2
[AR2]aaa
[AR2-aaa]local-user hcnp password cipher hcnp123
[AR2-aaa]local-user hcnp service-type ppp
Info: Add a new user.
[AR2-aaa]qu
[AR2]ip pool PPPoE   #配置位址池,用于分發位址
Info: It's successful to create an IP address pool.
[AR2-ip-pool-PPPoE]network 202.100.1.0 mask 24  #華為設定從最高的位址開始配置設定,是以第一個配置設定的位址是202.100.1.254
[AR2-ip-pool-PPPoE]excluded-ip-address 202.100.1.2   #因為這個位址是pppoe伺服器使用的位址,是以該位址不分發
[AR2-ip-pool-PPPoE]dns-list 8.8.8.8  #配置分發的dns
[AR2-ip-pool-PPPoE]qu
[AR2]interface Virtual-Template 1   #配置虛拟模闆和調用模闆
May  1 2020 09:14:35-08:00 AR2 %%01IFPDT/4/IF_STATE(l)[0]:Interface Virtual-Temp
late1 has turned into UP state.
[AR2-Virtual-Template1]remote address pool PPPoE
[AR2-Virtual-Template1]ip address 202.100.1.2 24
[AR2-Virtual-Template1]qu
[AR2]interface g0/0/0
[AR2-GigabitEthernet0/0/0]pppoe-server bind virtual-template 1
[AR2-GigabitEthernet0/0/0]ppp authentication-mode chap   #該接口使用chap認證
[AR2]ip route-static 0.0.0.0 0 202.100.1.254
           
ensp-PPPoE實驗

繼續閱讀