HDLCPPP的叙述及验证<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

WAN概述:

 广域网连接的场所

 根据用户不同的需求提供不同的连接方案

PPP支持NCPC(网络控制协议)和LCP(链路控制协议)

广域网连接类型:物理层

 在通常下,它都是用到了三种连接专线:

  . 点到点专线:提供专用的永久链接,当经常与多个地点连接时,使用专线是主要的方法。

  . 电路交换:被广泛适用于电话的网络中,ISDN/PSTN就是广域网电路交换的一个例子。

             主要用于把临时的远程用户和移动用户连接到局域网,还常用于高速线路的备份。

  . 分组交换连接:广域网的一种交换方式,网络设备共享一条点到点的线路,将数据包从源端经过通信网络传送到目的地址。

      帧中继是一种节省成本的方法,通过虚电路与其它站点连接,帧中继大多由通信公司服务供应商实现。

   HDLC:是在同步数据链路控制封装协议发展而来的数据链路层协议。

HDLCCISCO串行线路的缺省封装协议,只允许CISCO专用设备的连接,与其他的供应商的设备不兼容。

如果与没有运行CISOC IOS的设备连接应当使用PPP

广域网帧的封装格式:

 

 

最常用的两个点对点广域网封装协议是HDLCPPP

PPP:用于在链路建立过程当中检查链路质量;另外,还支持PAPCHAP密码验证

HDLC:是思科串行线路的缺省协议,只允许点对点的连接

如果连接的是非CISCO设备,就需要使用其他的数据封装类型。如FRPPP

PPP的协议作用:

能够控制数据链路的建立

能够对广域网的IP地址进行分配和管理

 允许同时采用多种网络层路由协议

 能够配置和测试数据链路

 能够有效进行错误检

80年代末,人们在串行线路协议(SLIP)基础上开发PPP协议来解决远程互联网连接的问题。

PPP综述:

 PPP可以通过NCP携带多个协议的数据包

 PPP可以通过LCP建立和控制连接

PPP会话的建立:

1 链路建立

2 验证阶段

3 网络层协议连接

PPP的两种验证协议:PAPCHAP

PPP验证:

PPP会话中,验证是可选的。

如果需要验证,则须通信双方的路由器要交换彼此的验证信息。

可以选择使用密码验证协议PAP或询问握手验证协议CHAP;在一般情况下,CHAP是首选协议。

密码验证协议PAP

PAP:两次握手,密码在链路上是明文传输的;连接建立后,需要不停地在链路上反复发送用户名和密码;远程节点受到登录尝试的频率和定时的即制。

密码验证协议CHAP

  第一步:拨号者发起CHAP呼叫

  第二步:向拨号者发送挑战信息

  第三步:拨号者处理挑战消息

  第四步:拨号者向访问服务器发送挑战应答

  第五步:访问服务器检查拨号者发过来的应答数据包

  第六步:访问服务器向拨号者发送认证通过/失败的消息。

下面配置及验证PAPCHAP

R1:

Router>en

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#host r1

r1(config)#int s0/0

r1(config-if)#ip addr 192.168.1.1 255.255.255.0

r1(config-if)#clock rate 64000

r1(config-if)#no shut

      r1(config-if)#encapsulation ppp

        r1(config-if)#ppp authen chap pap

r1(config-if)#ppp chap hostname r1

        r1(config-if)#ppp chap password cisco

      r1(config-if)#exit

        r1(config)#enable secret cisco

        r1(config)#service password-encryption

        r1(config)#username r2 password cisco

       R2:(PAP)

        Router>en

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#host r2

r2(config)#int s0/0

r2(config-if)#ip addr 192.168.1.3 255.255.255.0

r2(config-if)#no shut

r2(config-if)#encapsulation ppp

r2(config-if)#ppp authen pap chap

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

r2(config-if)#exit

r2(config)#enable password cisco

r2(config)#username r1 password cisco

r2(config)#exit

验证命令:

Show ip int s0/0

Show int s0/0

R1:

 

r1#show int s0/0

Serial0/0 is up, line protocol is up

       Hardware is M4T

       Internet address is 192.168.1.1/24

       MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,

      reliability 255/255, txload 1/255, rxload 1/255

      Encapsulation PPP, LCP Open

      Open: IPCP, CDPCP, crc 16, loopback not set

      Keepalive set (10 sec)

  Restart-Delay is 0 secs

      Last input 00:00:05, output 00:00:00, output hang never

      Last clearing of "show interface" counters 00:01:28

  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0

      Queueing strategy: weighted fair

      Output queue: 0/1000/64/0 (size/max total/threshold/drops)

      Conversations  0/1/256 (active/max active/max total)

      Reserved Conversations 0/0 (allocated/max allocated)

      Available Bandwidth 1158 kilobits/sec

      5 minute input rate 0 bits/sec, 0 packets/sec

  5 minute output rate 0 bits/sec, 0 packets/sec

      30 packets input, 1059 bytes, 0 no buffer

      Received 0 broadcasts, 0 runts, 0 giants, 0 throttles

      0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

      40 packets output, 904 bytes, 0 underruns

 --More--

R2:

 

r2#show int s0/0

Serial0/0 is,line protocol is up

     Hardware is M4T

     Internet address is 192.168.1.3/24

     MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,

      reliability 255/255, txload 1/255, rxload 1/255

     Encapsulation PPP, LCP Open

     Open: IPCP, CDPCP, crc 16, loopback not set

     Keepalive set (10 sec)

     Restart-Delay is 0 secs

     Last input 00:00:12, output 00:00:03, output hang never

     Last clearing of "show interface" counters 00:00:19

     Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0

     Queueing strategy: weighted fair

     Output queue: 0/1000/64/0 (size/max total/threshold/drops)

       Conversations  0/1/256 (active/max active/max total)

       Reserved Conversations 0/0 (allocated/max allocated)

       Available Bandwidth 1158 kilobits/sec

     5 minute input rate 0 bits/sec, 0 packets/sec

     5 minute output rate 0 bits/sec, 0 packets/sec

      19 packets input, 297 bytes, 0 no buffer

      Received 0 broadcasts, 0 runts, 0 giants, 0 throttles

      0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

      18 packets output, 285 bytes, 0 underruns

  --More—

一些配置验证命令:

提供需要验证的对方路由器的名称和密码

Router(config)#username name password password

给路由器命名

Router(config)#hostname name

激活 PAP CHAP 验证

Router(config-if)#ppp authentication
{chap | chap pap | pap chap | pap

激活 PPP 验证

Router(config-if)#encapsulation ppp

 

 

呵呵!看看,试验成功!