《PPP(H3C)-.pdf》由会员分享,可在线阅读,更多相关《PPP(H3C)-.pdf(6页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、PPP1PPP(H3C)关于 PPP原理性的内容在计算机网络集成技术一书中已经有了详细的介绍,本部分只是对H3C 设备上 PPP身份验证的具体实现进行讲解。需要注意的是,在 H3C 路由器上,串行链路的默认封装即为PPP,因此一般不需要再对其进行封装类型的配置。11.1 PAP 验证在 H3C 路由器上,PAP 验证的配置同样分为主验证方和被验证方的配置。主验证方的配置如下:H3C-Serial1/0link-protocolpppH3C-Serial1/0ppp authentication-mode papH3Clocal-userusernameH3C-luser-usernamepas
2、sword simple|cipherpasswordH3C-luser-usernameservice-type ppp在主验证方,配置串口的封装类型为PPP(该步骤可以省略),指定串口上使用的验证类型为 PAP。在全局视图下将被验证方的用户名和密码加入到本地用户列表并指定其服务类型为 PPP。被验证方的配置如下:H3C-Serial1/0link-protocolpppH3C-Serial1/0ppp pap local-userusernamepasswordsimple|cipherpassword在被验证方,配置串口的封装类型为PPP(该步骤可以省略),指定被验证方进行PAP验证时在
3、链路上发送的用户名和密码。在如图 11-1 所示的网络中,配置 PAP验证,要求路由器RTA 为被验证方,路由器 RTB为主验证方。图 11-1 PAP 验证配置具体配置如下:RTAinterface Serial 1/0RTA-Serial1/0link-protocolpppRTA-Serial1/0ppp pap local-user abc passwordsimple 123RTBinterface Serial 2/0RTB-Serial2/0link-protocolpppPPP2RTB-Serial2/0ppp authentication-mode papRTB-Serial
4、2/0quitRTBlocal-user abcRTB-luser-abcpassword simple 123RTB-luser-abcservice-type ppp配置完成后,路由器RTA 向路由器RTB 发送自己的用户名abc 和密码 123,请求 PAP验证。在路由器RTA 上执行 debugging ppp papall 命令查看验证过程如下:debugging ppp pap allsystem-viewSystemView:return to User View with Ctrl+Z.RTAinterface Serial 1/0RTA-Serial1/0shutdownRT
5、A-Serial1/0%Sep 17 10:00:28:3852010 RTA IFNET/3/LINK_UPDOWN:Serial1/0 linkstatus isDOWN.%Sep 17 10:00:28:386 2010 RTA IFNET/5/LINEPROTO_UPDOWN:Line protocol on theinterface Serial1/0 is DOWN.%Sep 17 10:00:28:386 2010 RTA IFNET/5/PROTOCOL_UPDOWN:Protocol PPPIPCP onthe interface Serial1/0 is DOWN.RTA-
6、Serial1/0undo shutdownRTA-Serial1/0%Sep 17 10:00:37:518 2010 RTA IFNET/3/LINK_UPDOWN:Serial1/0 link statusis UP.%Sep 17 10:00:40:526 2010 RTA IFNET/5/LINEPROTO_UPDOWN:Line protocol on theinterface Serial1/0 is UP.*Sep 17 10:00:40:526 2010 RTA PPP/7/debug2:PPPEvent:Serial1/0 PAPInitialEventstateIniti
7、al*Sep 17 10:00:40:526 2010 RTA PPP/7/debug2:PPPEvent:Serial1/0 PAPClient Lower Up EventstateInitial*Sep 17 10:00:40:527 2010 RTA PPP/7/debug2:PPPPacket:Serial1/0 Output PAP(c023)Pkt,Len 16StateInitial,codeRequest(01),id 1,len12Host Len:3Name:abcPwd Len:3Pwd:123*Sep 17 10:00:40:527 2010 RTA PPP/7/de
8、bug2:PPPStateChange:Serial1/0 PAP:Initial-SendRequest*Sep 17 10:00:40:537 2010 RTA PPP/7/debug2:PPPPacket:Serial1/0 InputPAP(c023)Pkt,Len 36PPP3StateServerListen,codeAck(02),id 1,len 32Msg Len:27Msg:Welcome to usethis device.*Sep 17 10:00:40:537 2010 RTA PPP/7/debug2:PPPEvent:Serial1/0 PAPReceiveAck
9、 EventstateSendRequest*Sep 17 10:00:40:537 2010 RTA PPP/7/debug2:PPPStateChange:Serial1/0 PAP:SendRequest-ClientSuccess%Sep 17 10:00:40:544 2010 RTA IFNET/5/PROTOCOL_UPDOWN:Protocol PPPIPCP onthe interface Serial1/0 is UP.在这里先将路由器RTA 的接口 Serial 1/0 关闭,然后激活,使两台路由器之间重新建立PPP连接,可以看到PAP的验证过程。在本例中,只是配置了单向
10、验证,也可以配置双向验证,使路由器RTA 和 RTB 互相进行验证。11.2 CHAP 验证在 H3C 路由器上,CHAP 验证的配置存在两种不同的方式,下面分别对其进行介绍。11.2.1 方式一主验证方的配置如下:H3C-Serial1/0link-protocolpppH3C-Serial1/0ppp authentication-mode chapH3C-Serial1/0ppp chap userusernameH3Clocal-userusernameH3C-luser-usernamepassword simple|cipherpasswordH3C-luser-usernames
11、ervice-type ppp在主验证方,配置串口的封装类型为PPP(该步骤可以省略),指定串口上使用的验证类型为 CHAP。通过 ppp chap user 命令指定发送到对端设备进行CHAP 验证时使用的用户名,该用户名要求必须与被验证方的local-user 指定的用户名一致。在全局视图下将被验证方的用户名和密码加入到本地用户列表并指定其服务类型为PPP,要求密码必须与被验证方的密码相同。被验证方的配置如下:H3C-Serial1/0link-protocolpppH3C-Serial1/0ppp chap userusernameH3Clocal-userusernameH3C-lus
12、er-usernamepassword simple|cipherpasswordH3C-luser-usernameservice-type ppp可以看出,被验证方的配置只是少了一条指定验证类型的命令ppp authentication-modechap,其他命令相同。同样要求命令ppp chap user中指定的用户名要与主验证方的local-user指定的用户名一致。密码必须与主验证方的密码相同。在此依然使用如图11-1 所示的网络,配置CHAP 验证,要求路由器RTA 为被验证方,路由器 RTB 为主验证方。PPP4具体配置如下:RTAinterface Serial 1/0RTA-
13、Serial1/0link-protocolpppRTA-Serial1/0ppp chap userRTARTA-Serial1/0quitRTAlocal-user RTBRTA-luser-RTBpassword simple 123RTA-luser-RTBservice-type pppRTBinterface Serial 2/0RTB-Serial2/0link-protocolpppRTB-Serial2/0ppp authentication-mode chapRTB-Serial2/0ppp chap userRTBRTB-Serial2/0quitRTBlocal-use
14、r RTARTB-luser-RTApassword simple 123RTB-luser-RTAservice-type ppp在上述配置中,路由器RTA 和 RTB 配置的本地用户名称均为对端的用户名,实际上local-user 配置的本地用户名只要和对端的ppp chapuser 命令配置的用户名相同即可,并不要求一定使用对端的用户名称。配置完成后,在路由器RTA 上执行 debugging ppp chapall 命令查看验证过程如下:debugging ppp chap allsystem-viewSystemView:return to User View with Ctrl+Z
15、.RTAinterface Serial 1/0RTA-Serial1/0shutdownRTA-Serial1/0%Sep 17 10:38:31:9582010 RTA IFNET/3/LINK_UPDOWN:Serial1/0linkstatus isDOWN.%Sep 17 10:38:31:958 2010 RTA IFNET/5/LINEPROTO_UPDOWN:Line protocol on theinterface Serial1/0 is DOWN.%Sep 17 10:38:31:959 2010 RTA IFNET/5/PROTOCOL_UPDOWN:Protocol
16、PPPIPCP onthe interface Serial1/0 is DOWN.RTA-Serial1/0undo shutdownRTA-Serial1/0%Sep 17 10:38:39:498 2010 RTA IFNET/3/LINK_UPDOWN:Serial1/0 link statusis UP.%Sep 17 10:38:42:505 2010 RTA IFNET/5/LINEPROTO_UPDOWN:Line protocol on theinterface Serial1/0 is UP.*Sep 17 10:38:42:506 2010 RTA PPP/7/debug
17、2:PPPEvent:Serial1/0 CHAP Initial EventstateInitial*Sep 17 10:38:42:506 2010 RTA PPP/7/debug2:PPPEvent:PPP5Serial1/0 CHAP Client Lower Up EventstateInitial*Sep 17 10:38:42:506 2010 RTA PPP/7/debug2:PPPStateChange:Serial1/0 CHAP:Initial-ListenChallenge*Sep 17 10:38:42:510 2010 RTA PPP/7/debug2:PPPPac
18、ket:Serial1/0 InputCHAP(c223)Pkt,Len 28StateListenChallenge,codeChallenge(01),id 1,len 24Value_Size:16Value:3eeec b4 fe 6def1 44 6b 67 af 70 73 64 37Name:RTB*Sep 17 10:38:42:510 2010 RTA PPP/7/debug2:PPPEvent:Serial1/0 CHAP Receive Challenge EventstateListenChallenge*Sep 17 10:38:42:511 2010 RTA PPP
19、/7/debug2:PPPPacket:Serial1/0 Output CHAP(c223)Pkt,Len 28StateListenChallenge,codeResponse(02),id 1,len 24Value_Size:16Value:34 42 87 a73 9f df 38 7f 22 4a 68 4d 58 96 84Name:RTA*Sep 17 10:38:42:511 2010 RTA PPP/7/debug2:PPPStateChange:Serial1/0 CHAP:ListenChallenge-SendResponse*Sep 17 10:38:42:521
20、2010 RTA PPP/7/debug2:PPPPacket:Serial1/0 InputCHAP(c223)Pkt,Len 23StateSendResponse,codeSUCCESS(03),id 1,len 19Message:Welcome to RTB.*Sep 17 10:38:42:621 2010 RTA PPP/7/debug2:PPPEvent:Serial1/0 CHAP Receive SuccessEventstateSendResponse*Sep 17 10:38:42:772 2010 RTA PPP/7/debug2:PPPStateChange:Ser
21、ial1/0 CHAP:SendResponse-ClientSuccess%Sep 17 10:38:42:872 2010 RTA IFNET/5/PROTOCOL_UPDOWN:Protocol PPPIPCP onthe interface Serial1/0 is UP.在这里先将路由器RTA 的接口 Serial 1/0 关闭,然后激活,使两台路由器之间重新建立PPP连接,可以看到CHAP 的验证过程。从验证过程中可以看出,与PAP在发送的验证报文中包含了用户名和密码不同,在CHAP 报文中只包含了用户名,并不包含密码。11.2.2 方式二主验证方配置如下:H3C-Serial1/
22、0link-protocolpppPPP6H3C-Serial1/0ppp authentication-mode chapH3Clocal-userusernameH3C-luser-usernamepassword simple|cipherpasswordH3C-luser-usernameservice-type ppp被验证方配置如下:H3C-Serial1/0link-protocolpppH3C-Serial1/0ppp chap userusernameH3C-Serial1/0ppp chap passwordsimple|cipherpassword方式二的配置比方式一相对
23、要简单一些。在方式二中,被验证方在接口视图下通过命令ppp chap password 配置进行CHAP 验证时使用的密码,而不再进行本地用户的配置。由于被验证方不再通过查找本地用户获得密码,因此在主验证方也就不再需要配置ppp chap user命令。在此依然使用如图11-1 所示的网络,要求使用方式二配置CHAP 验证,其中路由器RTA为被验证方,路由器RTB 为主验证方。具体配置如下:RTAinterface Serial 1/0RTA-Serial1/0link-protocolpppRTA-Serial1/0ppp chap userRTARTA-Serial1/0ppp chap passwordsimple 123RTBinterface Serial 2/0RTB-Serial2/0link-protocolpppRTB-Serial2/0ppp authentication-mode chapRTB-Serial2/0quitRTBlocal-user RTANew local useradded.RTB-luser-RTApassword simple 123RTB-luser-RTAservice-type pppCHAP 也可以配置双向验证,使路由器RTA 和 RTB 互相进行验证。