1. 前言
广域网中经常会使用串行链路来提供远距离的数据传输,高级数据链路控制HDLC(High-Level Data Link Control )和点对点协议PPP(Point to Point Protocol)是两种典型的串口封装协议。
2.什么是HDLC?
高级数据链路控制(High-Level Data Link Control或简称HDLC),是一个在同步网上传输 数据、面向比特的数据链路层协议,它是由国际标准化组织(ISO)根据IBM公司的SDLC(Synchronous Data Link Control)协议扩展开发而成的。
HDLC有三种类型的帧:
1.信息帧(I):数据传送
2.监控帧(S):差错控制和流量控制
3.无编号帧(U):链路建立连接拆除
2.什么是PPP?
点对点协议(Point to Point Protocol,PPP)为在点对点连接上传输多协议数据包提供了一个标准方法。PPP 最初设计是为两个对等节点之间的 IP 流量传输提供一种封装协议。在 TCP-IP 协议集中它是一种用来同步调制连接的数据链路层协议(OSI模式中的第二层),替代了原来非标准的第二层协议,即 SLIP。除了 IP 以外 PPP 还可以携带其它协议,包括 DECnet 和 Novell 的 Internet 网包交换(IPX)。
3.HDLC基本配置

[RTA]interface Serial 4/0/0
[RTA-Serial4/0/0] link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed.Continue? [Y/N]: y
[RTA-Serial4/0/0] ip address 10.0.1.1 24
具体配置如下图
#
sysname AR1
#
board add 0/4 2SA
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface Serial4/0/0
link-protocol hdlc
ip address 10.1.1.1 255.255.255.0
#
interface Serial4/0/1
link-protocol ppp
#
interface GigabitEthernet0/0/0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
4.HDLC接口地址借用
穿行接口可以借用Loopback接口的IP地址和对端建立连接。通过配置OSPF互通。
[AR1] interface Serial 4/0/0
[AR1-Serial4/0/0] link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed.Continue? [Y/N]: y
[AR1-Serial4/0/0] ip address unnumbered interface loopBack 0
[AR1] ip route-static 10.1.1.1 24 Serial 4/0/0
具体配置如下:
#
sysname AR1
#
board add 0/4 2SA
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface Serial4/0/0
link-protocol hdlc
ip address unnumbered interface LoopBack0
#
interface Serial4/0/1
link-protocol ppp
#
interface GigabitEthernet0/0/0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
5.PPP协议应用
1>.LCP(链路控制协议 Link Control Protocol):用来建立、拆除和监控PPP数据链路
2>.NCP(网络层控制协议 Network Control Protocol):用于对不同的网络层协议进行连接建立和参数协商。
6.PPP链路建立过程

7.PPP—LCP报文参数



LCP是一个单向帧
8.PPP基本配置

[AR3]interface Serial 4/0/0
[AR3-Serial4/0/0]link-protocol ppp
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[AR3-Serial4/0/0]ip address 10.1.1.1 24

9.PPP认证模式
1>.PPP认证模式—PAP

2>.PPP认证模式—CHAP

9.NCP报文协商
1>.IPCP静态协商

2>.IPCP动态协商

10.PPP认证配置
1>.PPP认证模式—PAP
环境如下图:

PAP配置如下图
AR3(认证方)配置
[AR3]aaa
[AR3-aaa]local-user huawei password cipher huawei
Info: Add a new user.
[AR3-aaa]local-user huawei service-type ppp
[AR3-aaa]inter s4/0/0
[AR3-Serial4/0/0]link-protocol ppp
[AR3-Serial4/0/0]ppp authentication-mode pap
[AR3-Serial4/0/0]ip address 10.1.1.1 24
AR4(被认证方)配置
[AR4]interface Serial 4/0/0
[AR4-Serial4/0/0]link-protocol ppp
[AR4-Serial4/0/0]ppp pap local-user huawei password cipher huawei
[AR4-Serial4/0/0]ip add 10.1.1.2 24
2>.PPP认证模式—CHAP
环境如下图

CHAP配置如下图
AR4(认证方)配置
[AR4]aaa
[AR4-aaa]local-user chapuser password cipher huawei
Info: Add a new user.
[AR4-aaa]local-user chapuser service-type ppp
[AR4-aaa]inter s4/0/0
[AR4-Serial4/0/0]link-protocol ppp
[AR4-Serial4/0/0]ppp authentication-mode chap
[AR4-Serial4/0/0]ip address 10.1.1.1 24
AR3(被认证方)配置
[AR3]interface Serial 4/0/0
[AR3-Serial4/0/0]link-protocol ppp
[AR3-Serial4/0/0]ppp chap user chapuser
[AR3-Serial4/0/0]ppp chap password cipher huawei
[AR3-Serial4/0/0]ip add 10.1.1.2 24
网友评论