PPPoE的理解和实例

 

PPPoE 协议

PPP协议通过在以太网上提供点到点的连接,建立PPP会话,使得以太网中的主机能够连接到远端的宽带接入服务器上。PPPoE 具有适用范围广,安全性高,方便计费
因为PPP有认证协议,LCP,NCP 等,

数字用户线路DSL 是以电话线传输介质的传输技术,人们通常把所有的DSL技术统称为xDSL。

 

PPPoE的理解和实例_第1张图片

 

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

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.配置一条缺省路由

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]

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  
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.

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.

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)
 

    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

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    

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

 

你可能感兴趣的:(华为设备)