PPP协议PPP point to point点到点协议,是二层wan的协议。 连接的建立分为5个阶段分别是:dead阶段、established(LCP链路建立)阶段、authentcation认证阶段、network(网络控制协商参数)的NCP阶段、Terminate结束阶段。ppp分为lcp子层和ncp子层,lcp主要负责链路的建立和拆除、ncp主要负责在lcp建立链路完成后双方进行网络参数的协商,如ip地址、dns等的参数协商。如ipcp就是是包含在ncp子层中的一种专门负责ip协商的协议,ipxcp就是包含在ncp子层中的专门用于协商ipx的协议,因为NCP是一个协议族!WAN常用的点到点L2协议,用途最为广泛的协议,可以承载以太网、IP等多种协议(需要借用Virtual-Template虚拟接口来实现对以太网协议的支持,ip可以直接支持,可以直接在L3层配置ip地址)。ppp配置以华为路由器AR系列为例,实现PPP的配置,认证采用chap进行。拓扑如下:AR9为r1作为主认证端,AR10为r2作为被认证端,本例中只是用到ppp所以只使用s4/0/0接口相互连接做ppp链路。配置如下:r1认证端配置:[AR9]system-view 进入全局模式,相当于cosco的enable[AR9]sysname r1 改名为r1 [r1] aaa 启用aaa配置管理[r1-aaa]local-user u_ppp password cipher p_ppp 在aaa数据库中创建一个用户名为u_ppp密码为p_ppp的本地账户[r1-aaa]local-user u_ppp service-type ppp 指明aaa这个用户是用作进行ppp认证的[r1-aaa]quit 退出[r1]interface s4/0/0[r1]link-protocol ppp 为S4/0/0接口在L2层封装PPP协议[r1]ip address 12.1.1.1 255.255.255.0 为接口配置ip地址[r1-Serial4/0/0]ppp authentication-mode chap 在主认证端上指明ppp的认证方式为chap[r1-Serial4/0/0]remote address 12.1.1.22 给被认证端分配指定的ip(12.1.1.22/24)r2被认证端:[r2]interface s4/0/0 [r2]link-protocol ppp 为S4/0/0接口在L2层封装PPP协议[r2]ip address ppp-negotiate 被认证端配置为接口自动向主认证端获取ip地址[r2-Serial4/0/0]ppp chap user u_ppp 设置用于chap认证的用户名为u_ppp(与主认证端一致)[r2-Serial4/0/0]ppp chap password simple p_ppp 设置用于chap认证的密码为p_ppp(与主认证端一致)验证:查看ppp链路状态和查看r2上是否能自动获得r1分配的ip地址display interface s4/0/0Serial4/0/0 current state : UPLine protocol current state : UPLast line protocol up time : 2019-01-31 09:49:16 UTC-08:00Description:HUAWEI, AR Series, Serial4/0/0 InterfaceRoute Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)Internet protocol processing : disabledLink layer protocol is PPPLCP opened, IPCP opened 这里LCP子层和IPCP子层都open,ppp链路正常建立了Last physical up time : 2019-01-31 09:49:13 UTC-08:00Last physical down time : 2019-01-31 09:49:12 UTC-08:00Current system time: 2019-01-31 09:56:51-08:00Physical layer is synchronous, Virtualbaudrate is 64000 bpsInterface is DTE, Cable type is V11, Clock mode is TCLast 300 seconds input rate 6 bytes/sec 48 bits/sec 0 packets/secLast 300 seconds output rate 2 bytes/sec 16 bits/sec 0 packets/secdisplay ip interface briefInterface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 unassigned down down GigabitEthernet0/0/1 unassigned down down GigabitEthernet0/0/2 unassigned down down Serial4/0/0 12.1.1.22/32 up up 被认证端的接口自动获取到了ip地址NULL0 unassigned up up(s)MP-PPP及配置MP-PPP是多条ppp链路进行逻辑捆绑的技术,主要用于解决带宽不足、冗余备份链路、提高ppp链路使用的灵活性等方面的问题。配置方面,MP-PPP有三种配置方法:1、使用Virtual-Template虚拟接口,将多条物理链路绑定到VT接口形成MP-PPP2、使用Virtual-Template基于用户名的MP-PPP建立,根据不同的用户名来进行不同的MP-PPP的捆绑(必须配置ppp认证)3、使用MP-group来配置MP-PPP,将多条物理链路捆绑接口加入MP-group组来形成MP-PPP捆绑(多数情况使用MP-group来进行配置,因为MP-group是专门用于MP-PPP的,配置明了,功能灵活)本例中只介绍使用MP-Group进行MP-PPP的配置,实用配置。 以上图为例,r1与r2使用链条链路连接,现在为了更好的增加带宽,需要将两条ppp链路捆绑成为一条MP-PPP链路,配置如下:r1作为主认证方上配置:1、首先依然是进入aaa增加一个用于ppp认证的用户(u_ppp)和密码(p_ppp)aaalocal-user ppp password cipher u_ppplocal-user ppp service-type p_ppp2、创建MP-group接口interface Mp-group0/0/0 remote address 12.1.1.22 为对端的mp-group接口分配ip地址 ip address 12.1.1.1 255.255.255.0 本接口ip地址,物理接口下就不用在配置ip地址了3、分别在物理接口下开启ppp的chap认证,并将2条物理链路的接口加入到MP-group组中interface Serial4/0/0 link-protocol ppp ppp authentication-mode chap 在物理接口下启用ppp认证是因为mp-group接口不支持认证,只能在物理接口下做。 ppp mp Mp-group 0/0/0 将物理接口加入mp-group组中#interface Serial4/0/1 同上配置 link-protocol ppp ppp authentication-mode chap ppp mp Mp-group 0/0/0#r2作为被认证方配置:interface Mp-group0/0/0ip address ppp-negotiate 配置mp-group接口为获取ip地址#interface Serial4/0/0 link-protocol ppp ppp chap user u_ppp 被认证端chap认证使用的用户名为u_ppp ppp chap password simple p_ppp 被认证端chap认证使用的密码为p_ppp(明文) ppp mp Mp-group 0/0/0 将物理接口加入mp-group组中#interface Serial4/0/1 同上 link-protocol ppp ppp chap user u_ppp ppp chap password simple p_ppp ppp mp Mp-group 0/0/0#验证:display ppp mp Mp-group is Mp-group0/0/0 ===========Sublinks status begin====== Serial4/0/0 physical UP,protocol UP Serial4/0/1 physical UP,protocol UP ===========Sublinks status end======== Bundle Multilink, 2 members, slot 0, Master link is Mp-group0/0/0 包含2条链路 0 lost fragments, 0 reordered, 0 unassigned, sequence 0/0 rcvd/sent The bundled sub channels are: 组中包含的ppp接口是: Serial4/0/0 Serial4/0/1或者查看物理接口,可以看到红色的:display interface s4/0/0Serial4/0/0 current state : UPLine protocol current state : UPLast line protocol up time : 2019-01-31 09:49:16 UTC-08:00Description:HUAWEI, AR Series, Serial4/0/0 InterfaceRoute Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)Internet protocol processing : disabledLink layer protocol is PPPLCP opened, MP opened 说明是属于MP-group组的Last physical up time : 2019-01-31 09:49:13 UTC-08:00Last physical down time : 2019-01-31 09:49:12 UTC-08:00Current system time: 2019-01-31 09:23:53-08:00Physical layer is synchronous, Virtualbaudrate is 64000 bpsInterface is DTE, Cable type is V11, Clock mode is TCLast 300 seconds input rate 6 bytes/sec 48 bits/sec 0 packets/secLast 300 seconds output rate 2 bytes/sec 16 bits/sec 0 packets/sec