简单总结PPPoE设置

实验简介:配置路由器ADSL_SRV与ADSL_CLN,使双方通过PPPoE通信
拓扑描述:ADSL_SRV(F1/0)-(F1/0)ADSL_CLN
实验软件:GNS3 0.61
实验目的:在ADSL_CLN能够ping通ADSL_SRV的loopback口
实验描述:
一、在ADSL_SRV上配置:
1、BBA-GROUP,用于设定PPPoE profile;
2、指定该BBA-Group使用virtual-template 1;
3、定义interface virtual-template 1,包括
(1)根据前辈的建议,使用ip unnumbered loopback0作为ip地址;
(2)客户端的地址定义,这里我采用dhcp-pool作为客户端的ip地址;若觉得复杂的话,可以使用local pool定义对端ip地址范围;
(3)封装,当然是ppp了;
(4)认证,采用简单一点的pap吧;
4、定义dhcp pool,这里分配给客户端10.0.0.2 �C 10.0.0.10;
5、外连以太网口启用pppoe,profile为bba-group所定义的。
二、在ADSL_CLN上配置:
1、定义dialer 1:
(1)ip采用dhcp;
(2)封装使用ppp,并定义pap认证使用的用户名、密码;
(3)拨号池为1;
2、以太网口启用pppoe,作为client使用dialer 1拨号。
 
主要配置:
ADSL_SRV#
hostname ADSL_SRV
!
ip dhcp excluded-address 10.0.0.11 10.0.0.254
!
ip dhcp pool ADSL_DHCP_POOL
   network 10.0.0.0 255.255.255.0
   default-router 10.0.0.1
!
username cisco password 0 cisco
!
bba-group pppoe MY_ADSL
virtual-template 1
!
interface Loopback0
ip address 10.0.0.1 255.255.255.0
!
interface Loopback1
ip address 172.16.1.1 255.255.255.0
!
interface FastEthernet1/0
no ip address
duplex auto
speed auto
pppoe enable group MY_ADSL
!
interface Virtual-Template1
ip unnumbered Loopback0
peer default ip address dhcp-pool ADSL_DHCP_POOL
ppp authentication pap
!
end
-----------------难道看见了分割线???-----------------
ADSL_CLN:
hostname ADSL_CLN
!
interface FastEthernet1/0
description USE PPPOE WITH DIALER 1
no ip address
duplex auto
speed auto
pppoe enable group global
pppoe-client dial-pool-number 1
!
interface Dialer1
ip address dhcp
encapsulation ppp
dialer pool 1
ppp pap sent-username cisco password 0 cisco
!
end
 
DEBUG信息:
ADSL_SRV#debug pppoe events
ADSL_SRV#debug ip dhcp server events
-----------------------PADI(PPPoE Active Discovery Initiation)-----------------------
*Jun  7 10:42:08.595: PPPoE 0: I PADI  R:ca01.0868.001c L:ffff.ffff.ffff Fa1/0
*Jun  7 10:42:08.599:  Service tag: NULL Tag
-----------------------PADO(PPPoE Active Discovery Offer)-----------------------
*Jun  7 10:42:08.599: PPPoE 0: O PADO, R:ca00.0868.001c L:ca01.0868.001c Fa1/0
*Jun  7 10:42:08.599:  Service tag: NULL Tag
-----------------------PADR(PPPoE Active Discovery Request)-----------------------
*Jun  7 10:42:10.675: PPPoE 0: I PADR  R:ca01.0868.001c L:ca00.0868.001c Fa1/0
*Jun  7 10:42:10.675:  Service tag: NULL Tag
-----------------------PADS(PPPoE Active Discovery Session-confirmation)-----------------------
*Jun  7 10:42:10.679: PPPoE : encap string prepared
*Jun  7 10:42:10.679: [2]PPPoE 2: Access IE handle allocated
*Jun  7 10:42:10.679: [2]PPPoE 2: pppoe SSS switch updated
*Jun  7 10:42:10.679: [2]PPPoE 2: AAA unique ID allocated
*Jun  7 10:42:10.683: [2]PPPoE 2: No AAA accounting method list
*Jun  7 10:42:10.683: [2]PPPoE 2: Service request sent to SSS
*Jun  7 10:42:10.687: [2]PPPoE 2: Created, Service: None R:ca00.0868.001c L:ca01.0868.001c Fa1/0
*Jun  7 10:42:10.699: [2]PPPoE 2: State NAS_PORT_POLICY_INQUIRY    Event SSS_LOCAL
*Jun  7 10:42:10.699: [2]PPPoE 2: O PADS  R:ca01.0868.001c L:ca00.0868.001c Fa1/0
-----------------------使用PPP流程处理连接-----------------------
*Jun  7 10:42:10.711: [2]PPPoE 2: State PPP_START    Event DYN_BIND
*Jun  7 10:42:10.711: [2]PPPoE 2: data path set to PPP
-----------------------发送LCP(Link Control Protocol)数据包来配置和测试数据通信链路-----------------------
*Jun  7 10:42:12.811: [2]PPPoE 2: State LCP_NEGOTIATION    Event PPP_LOCAL
*Jun  7 10:42:12.811: PPPoE 2/SB: Sent vtemplate request on base Vi1
*Jun  7 10:42:12.831: [2]PPPoE 2: State VACCESS_REQUESTED    Event VA_RESP
*Jun  7 10:42:12.831: [2]PPPoE 2: Vi1.1 interface obtained
*Jun  7 10:42:12.835: [2]PPPoE 2: State PTA_BINDING    Event STAT_BIND
*Jun  7 10:42:12.835: [2]PPPoE 2: data path set to Virtual Acess
*Jun  7 10:42:12.839: [2]PPPoE 2: Connected PTA
-----------------------DHCP分配地址-----------------------
*Jun  7 10:42:13.227: DHCPD: allocate request for client cisco on Virtual-Access1.1.
*Jun  7 10:42:13.231: DHCPD: Pool ADSL_DHCP_POOL specified.
*Jun  7 10:42:13.231: DHCPD: Interface Virtual-Access1.1 is not associated with any VRF.
*Jun  7 10:42:13.231: DHCPD: found pool ADSL_DHCP_POOL for client cisco.
*Jun  7 10:42:15.231: DHCPD: Adding binding to radix tree (10.0.0.2)
*Jun  7 10:42:15.231: DHCPD: Adding binding to hash tree
*Jun  7 10:42:15.231: DHCPD: assigned IP address 10.0.0.2 to client 6369.7363.6f.
 
ADSL_CLN#debug pppoe events
*Jun  7 10:42:07.875:  padi timer expired
-----------------------PADI(PPPoE Active Discovery Initiation)-----------------------
*Jun  7 10:42:07.875:  Sending PADI: Interface = FastEthernet1/0
-----------------------PADO(PPPoE Active Discovery Offer)-----------------------
*Jun  7 10:42:07.907: PPPoE 0: I PADO  R:ca00.0868.001c L:ca01.0868.001c Fa1/0
*Jun  7 10:42:09.923:  PPPOE: we've got our pado and the pado timer went off
-----------------------PADR(PPPoE Active Discovery Request)-----------------------
*Jun  7 10:42:09.923: OUT PADR from PPPoE Session
-----------------------PADS(PPPoE Active Discovery Session-confirmation)-----------------------
*Jun  7 10:42:10.015: PPPoE 2: I PADS  R:ca00.0868.001c L:ca01.0868.001c Fa1/0
*Jun  7 10:42:10.015: IN PADS from PPPoE Session
-----------------------
*Jun  7 10:42:10.027: %DIALER-6-BIND: Interface Vi2 bound to profile Di1
*Jun  7 10:42:10.031: PPPoE: Virtual Access interface obtained.
*Jun  7 10:42:10.031: PPPoE : encap string prepared
*Jun  7 10:42:10.031: [0]PPPoE 2: data path set to Virtual Acess
*Jun  7 10:42:10.043: %LINK-3-UPDOWN: Interface Virtual-Access2, changed state to up
*Jun  7 10:42:13.331: %LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access2, changed state to up
 
解释一下:(下面说明摘录自 http://blog.sina.com.cn/s/blog_4db83b6f01000apf.html)
1. PADI:PPPoE发现阶段的第一步。用户主机以广播的方式发送PADI数报包,请求建立链路。Code域置为0x09,会话ID域必须置为0x0000。
2. PADO:PPPoE发现阶段的第二步。访问集中器(AC)以单播的方式发送一个PADO数据包对主机的请求做出应答。目的地址为主机的MAC地址,Code域置为0x07,会话ID域必须置为0x0000。PADO数据包必须包含一个类型为AC-Name的Tag(包含了访问集中器的名字)。
3. PADR:PPPoE发现阶段的第三步。因为PADI数据包是广播的,所以主机可能收到不止一个的PADO报文。主机在收到报文后,会根据AC-Name或者PADO所提供的服务来选择一个AC,然后主机向选中的AC单播一个PADR数据包。目的地址域为AC的MAC地址,Code域置为0x19,会话ID域必须置为0x0000。PADR报文必须且只能包含一个Tag_Type为Service-Name的Tag,表明主机请求的服务。
4. PADS:PPPoE发现阶段最后一步。当AC在收到PADR报文时,就准备开始一个PPP的会话了。它为PPPoE会话创建一个唯一的会话ID并用单播一个PADS数据包来给主机做出响应。目的地址域为主机的MAC地址,Code域置为0x65,会话ID必须设置为所创建好的会话ID。

你可能感兴趣的:(职场,休闲,pppoe)