PPPoE的理解和實例

 

PPPoE 協議

PPP協議通過在以太網上提供點到點的連接,建立PPP會話,使得以太網中的主機能夠連接到遠端的寬帶接入服務器上。PPPoE 具有適用範圍廣,安全性高,方便計費
因爲PPP有認證協議,LCP,NCP 等,

數字用戶線路DSL 是以電話線傳輸介質的傳輸技術,人們通常把所有的DSL技術統稱爲xDSL。

 

 

###服務器端配置
1. ip pool
2. aaa-user/pass
3.virtul-template

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R2
###創建ip地址池
[R2]
[R2]ip pool pppoepool
Info: Its successful to create an IP address pool.

[R2-ip-pool-pppoepool]network 12.1.1.0 mask 24
[R2-ip-pool-pppoepool]di th
[V200R003C00]
#
ip pool pppoepool
 network 12.1.1.0 mask 255.255.255.0
#
return
###創建網關
[R2-ip-pool-pppoepool]gateway-list 12.1.1.2
###創建aaa用戶名和密碼
[R2-ip-pool-pppoepool]aaa
[R2-aaa]local-user huawei password cipher huawei
Info: Add a new user.
[R2-aaa]local-user huawei service-type ppp
[R2-aaa]q
##創建一個虛擬接口
[R2]interface Virtual-Template 1
[R2-Virtual-Template1]
Jun 30 2020 16:01:45-08:00 R2 %%01IFPDT/4/IF_STATE(l)[0]:Interface Virtual-Templ
##在接口上增加一個ip地址    
[R2-Virtual-Template1]ip address 12.1.1.2 24
##把地址池添加到虛擬接口上    
[R2-Virtual-Template1]remote address pool pppoepool
##設置認證方式
[R2-Virtual-Template1]ppp authentication-mode chap
[R2-Virtual-Template1]di th
[V200R003C00]
#
interface Virtual-Template1
 ppp authentication-mode chap
 remote address pool pppoepool
 ip address 12.1.1.2 255.255.255.0
#
return
[R2-Virtual-Template1]q
##進入物理接口綁定虛擬接口
[R2]interface GigabitEthernet 0/0/0
    
[R2-GigabitEthernet0/0/0]pppoe-server bind virtual-template 1
[R2-GigabitEthernet0/0/0]di th
[V200R003C00]
#
interface GigabitEthernet0/0/0
 pppoe-server bind Virtual-Template 1
#
return

####客戶端配置
1.設置一個撥號接口
2.在接口上將Dialer Bundle和接口綁定
3.配置一條缺省路由

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R1
##創建一個撥號規則
[R1]dialer-rule
[R1-dialer-rule]dialer-rule 10 ip permit
[R1-dialer-rule]q
##進入撥號接口設置ppp認證
[R1]interface Dialer 1
Jun 30 2020 16:05:16-08:00 R1 %%01IFPDT/4/IF_STATE(l)[0]:Interface Dialer1 has t
urned into UP state.
[R1-Dialer1]link    
[R1-Dialer1]link-protocol ppp
[R1-Dialer1]ip address ppp-negotiate
[R1-Dialer1]ppp chap user huawei
[R1-Dialer1]ppp chap password simple huawei
[R1-Dialer1]dialer user huawei
##放到一個撥號訪問組中
[R1-Dialer1]dialer-group 10
##將物理接口和撥號接口關聯起來
[R1-Dialer1]dialer bundle 2
[R1-Dialer1]q
##進入物理接口
[R1]interface GigabitEthernet 0/0/0
    
[R1-GigabitEthernet0/0/0]pppoe-client dial-bundle-number 2 on-demand
[R1-GigabitEthernet0/0/0]q
##創建一個缺省路由
[R1]ip route-static 0.0.0.0 0 Dialer 1
##查看配置
[R1]inter Dialer1
[R1-Dialer1]di th
[V200R003C00]
#
interface Dialer1
 link-protocol ppp
 ppp chap user huawei
 ppp chap password simple huawei
 ip address ppp-negotiate
 dialer user huawei
 dialer bundle 2
 dialer-group 10
#
return
[R1-Dialer1]q

##驗證
 

[R1]dis ip inter br
Interface                         IP Address/Mask      Physical   Protocol  
Dialer1                           unassigned           up         up(s)     
GigabitEthernet0/0/0              unassigned           up         down      
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           up         down      
NULL0                             unassigned           up         up(s)     
[R1]ping 12.1.1.2
  PING 12.1.1.2: 56  data bytes, press CTRL_C to break
    Request time out
Jun 30 2020 16:09:08-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
 on the interface Dialer1:0 has entered the UP state.
[R1]
    Request time out
Jun 30 2020 16:09:08-08:00 R1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP
 IPCP on the interface Dialer1:0 has entered the UP state.
[R1]
Jun 30 2020 16:09:08-08:00 R1 %%01RM/4/IPV4_DEFT_RT_CHG(l)[3]:IPV4 default Route
 is changed. (ChangeType=Delete, InstanceId=0, Protocol=Static, ExitIf=Dialer1,
Nexthop=0.0.0.0, Neighbour=0.0.0.0, Preference=1006632960, Label=NULL, Metric=0)
 
[R1]
    Request time out
    Reply from 12.1.1.2: bytes=56 Sequence=4 ttl=255 time=510 ms
    Reply from 12.1.1.2: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 12.1.1.2 ping statistics ---
    5 packet(s) transmitted
    2 packet(s) received
    60.00% packet loss
    round-trip min/avg/max = 20/265/510 ms

[R1]dis ip inter br
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
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                           12.1.1.254/32        up         up(s)     
GigabitEthernet0/0/0              unassigned           up         down      
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           up         down      
NULL0                             unassigned           up         up(s)     
[R1]

<R1>display pppoe-client session summary
PPPoE Client Session:
ID   Bundle  Dialer  Intf             Client-MAC    Server-MAC    State
0    2       1       GE0/0/0          00e0fc374f8d  000000000000  IDLE  
<R1>ping 12.1.1.2
  PING 12.1.1.2: 56  data bytes, press CTRL_C to break
    Request time out
Jun 30 2020 16:20:49-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
 on the interface Dialer1:0 has entered the UP state.
<R1>
Jun 30 2020 16:20:49-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
 IPCP on the interface Dialer1:0 has entered the UP state.
<R1>
Jun 30 2020 16:20:49-08:00 R1 %%01RM/4/IPV4_DEFT_RT_CHG(l)[2]:IPV4 default Route
 is changed. (ChangeType=Delete, InstanceId=0, Protocol=Static, ExitIf=Dialer1,
Nexthop=0.0.0.0, Neighbour=0.0.0.0, Preference=1006632960, Label=NULL, Metric=0)
 
<R1>
    Request time out
    Reply from 12.1.1.2: bytes=56 Sequence=3 ttl=255 time=40 ms
    Reply from 12.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 12.1.1.2: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 12.1.1.2 ping statistics ---
    5 packet(s) transmitted
    3 packet(s) received
    40.00% packet loss
    round-trip min/avg/max = 20/30/40 ms

<R1>display pppoe-client session summary
PPPoE Client Session:
ID   Bundle  Dialer  Intf             Client-MAC    Server-MAC    State
1    2       1       GE0/0/0          00e0fc374f8d  00e0fc5852e8  UP    
<R1>
<R1>display interface Dialer 1
Dialer1 current state : UP
Line protocol current state : UP (spoofing)
Description:HUAWEI, AR Series, Dialer1 Interface
Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)
Internet Address is negotiated, 12.1.1.254/32
Link layer protocol is PPP
LCP initial
Physical is Dialer
Current system time: 2020-06-30 16:21:43-08:00
    Last 300 seconds input rate 0 bits/sec, 0 packets/sec
    Last 300 seconds output rate 0 bits/sec, 0 packets/sec
    Realtime 0 seconds input rate 0 bits/sec, 0 packets/sec
    Realtime 0 seconds output rate 0 bits/sec, 0 packets/sec
    Input: 0 bytes
    Output:0 bytes
    Input bandwidth utilization  :    0%
    Output bandwidth utilization :    0%
Bound to Dialer1:0:
Dialer1:0 current state : UP ,
Line protocol current state : UP

Link layer protocol is PPP
LCP opened, IPCP opened
Packets statistics:
  Input packets:0,  0 bytes
  Output packets:3, 252 bytes
  FCS error packets:0
  Address error packets:0
  Control field control error packets:0

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章