第三节:关于PPP和PPPoE配置说明

3.1:PPP封装实验

3.2:PPPoE实验(实际应用比较广)

使用拓扑图:

pppoe配置举例(关于PPP和PPPoE配置说明)(1)

3.1:PPP实验

第一步:接口配置IP

R1(config)#interface serial 1/0

R1(config-if)#ip address 12.1.1.1 255.255.255.0

R1(config-if)#no shutdown

R2(config)#interface serial 1/0

R2(config-if)#ip address 12.1.1.2 255.255.255.0

R2(config-if)#no shutdown

第二步:查看接口状态(只截取有IP地址的接口)

R1(config)#do show ip interface brief

Interface IP-Address OK? Method Status Protocol

Serial1/0 12.1.1.1 YES manual up up

R2(config)#do show ip interface brief

Interface IP-Address OK? Method Status Protocol

Serial1/0 12.1.1.2 YES manual up up

第三步:在R2和R1的S1/0接口上封装PPP,查看接口状态

R2(config)#interface serial 1/0

R2(config-if)#encapsulation ppp //封装PPP

R2#show ip interface brief //查看接口,协议down

Interface IP-Address OK? Method Status Protocol

Serial1/0 12.1.1.2 YES manual up down

R1(config)#interface serial 1/0

R1(config-if)#encapsulation ppp //封装PPP

R1(config)#do show ip route connected //查看直连信息

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

a - application route

- replicated route, % - next hop override

Gateway of last resort is not set

12.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

C 12.1.1.0/24 is directly connected, Serial1/0

L 12.1.1.1/32 is directly connected, Serial1/0

C 12.1.1.2/32 is directly connected, Serial1/0

第四步:PPP的PAP认证(假设R1为认证方,R2为被认证方)

R1(config)#interface serial 1/0

R1(config-if)#ppp authentication pap

*Jun 12 09:08:03.303: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down

R1(config)#username test password cisco

R2(config)#interface serial 1/0

R2(config-if)#ppp pap sent-username test password cisco

认证过程:

R1#debug ppp authentication //验证认证过程

PPP authentication debugging is on

*Jun 12 09:11:01.423: Se1/0 PPP: Using default call direction

*Jun 12 09:11:01.423: Se1/0 PPP: Treating connection as a dedicated line

*Jun 12 09:11:01.423: Se1/0 PPP: Session handle[3A000008] Session id[6]

*Jun 12 09:11:01.452: Se1/0 PAP: I AUTH-REQ id 1 len 15 from "test"

*Jun 12 09:11:01.452: Se1/0 PAP: Authenticating peer test

*Jun 12 09:11:01.452: Se1/0 PPP: Sent PAP LOGIN Request

*Jun 12 09:11:01.452: Se1/0 PPP: Received LOGIN Response PASS

*Jun 12 09:11:01.457: Se1/0 PAP: O AUTH-ACK id 1 len 5

R1#

*Jun 12 09:11:01.457: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up //认证成功

3.2: PPPoE配置实验

使用拓扑图:(假设R1为客户端,R2为服务端)

pppoe配置举例(关于PPP和PPPoE配置说明)(2)

服务端配置:

R2(config)# bba-group pppoe test //创建pppoe模板

R2(config-bba-group)#virtual-template 10 //创建vir接口

R2(config)#interface Ethernet0/1

R2(config-if)#pppoe enable group test //接口开启pppoe关联模板

R2(config)#interface Virtual-Template10 //进入vir接口

R2(config-if)#no shutdown

R2(config-if)#mtu 1492 //修改mtu值

R2(config-if)#ip address 200.100.5.2 255.255.255.252 //配置接口地址

R2(config-if)#peer default ip address pool PPP //配置邻居从该地址池获取IP

R2(config-if)#ppp authentication chap //配置chap认证

R2(config)#username ccie password 0 cisco //本地创建用户名和密码

R2(config)#ip local pool PPP 200.100.5.1 //配置本地的地址池

客户端配置:

R1(config)#interface Ethernet0/1

R1(config-if)#pppoe enable //开启pppoe

R1(config-if)#pppoe-client dial-pool-number 1 //配置为客户端关联dial接口

R1(config)#interface Dialer1

R1(config-if)#mtu 1492 //修改MTU值

R1(config-if)#ip tcp adjust-mss 1452 //修改MSS值

R1(config-if)#ip address negotiated //地址通过自动协商获取

R1(config-if)#encapsulation ppp //接口封装ppp

R1(config-if)#dialer pool 1

R1(config-if)#ppp chap hostname ccie //配置用户名

R1(config-if)#ppp chap password 0 cisco //配置密码

验证:

R1#ping 200.100.5.2 sou dialer 1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 200.100.5.2, timeout is 2 seconds:

Packet sent with a source address of 200.100.5.1

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 5/8/15 ms

验证事件:

R1#debug pppoe event //pppoe事件

*May 11 10:27:19.716: %LINK-3-UPDOWN: Interface Dialer1, changed state to up

*May 11 10:27:31.889: Sending PADI: Interface = Ethernet0/1

*May 11 10:27:31.889: PPPoE 0: I PADO R:aabb.cc00.0610 L:aabb.cc00.0310 Et0/1

*May 11 10:27:34.018: PPPOE: we've got our pado and the pado timer went off

*May 11 10:27:34.018: OUT PADR from PPPoE Session

*May 11 10:27:34.023: PPPoE 2: I PADS R:aabb.cc00.0610 L:aabb.cc00.0310 Et0/1

*May 11 10:27:34.023: IN PADS from PPPoE Session

*May 11 10:27:34.023: %DIALER-6-BIND: Interface Vi2 bound to profile Di1

*May 11 10:27:34.023: PPPoE: Virtual Access interface obtained.

*May 11 10:27:34.023: PPPoE : encap string prepared

*May 11 10:27:34.023: [0]PPPoE 2: data path set to PPPoE Client

*May 11 10:27:34.024: %LINK-3-UPDOWN: Interface Virtual-Access2, changed state to up

*May 11 10:27:34.075: %LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access2, changed state to up

R1(config-if)#do show pppoe session

1 client session

Uniq ID PPPoE RemMAC Port VT VA State

SID LocMAC VA-st Type

N/A 2 aabb.cc00.0610 Et0/1 Di1 Vi2 UP

aabb.cc00.0310 UP

,