第六部分:广域网

HDLC和PPP原理 

串口封装协议:

HDLC 

配置:

interface Serial1/0/0

link-protocol hdlc  -------------默认为PPP,修改为HDLC

PPP ----------点到点的协议 

两个组成:

LCP  ----------------链路控制协议(各种链路层的协商)

LCP参数协商

MRU

认证

魔术字

LCP四个报文

Request

Ack

Nak

Reject

NCP-----------------网络控制协议(IPV4 V6  IPX  APPLETALK)

配置PPP

[AR1-Serial1/0/0]link-protocol  ppp 

Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:Y

检查:

[AR1]display  interface  Serial1/0/0

Serial1/0/0 current state : UP

Line protocol current state : DOWN

Description:HUAWEI, AR Series, Serial1/0/0 Interface

Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)

Internet Address is 12.1.1.1/24

Link layer protocol is PPP

LCP opened, IPCP opened

Last physical up time  : 2019-08-06 21:05:26 UTC-08:00

Last physical down time : 2019-08-06 21:05:25 UTC-08:00

Current system time: 2019-08-06 21:05:49-08:00

Physical layer is synchronous, Virtualbaudrate is 64000 bps

Interface is DTE, Cable type is V11, Clock mode is TC

Last 300 seconds input rate 4 bytes/sec 32 bits/sec 0 packets/sec

Last 300 seconds output rate 2 bytes/sec 16 bits/sec 0 packets/sec

PPP认证:

PAP认证 -------------密码认证协议

二次握手,明文认证

单向认证配置思路:

认证方:

第一步:配置数据库------给被认证方使用

aaa

local-user huawei password cipher  huawei---------------------定义用户名和密码

local-user huawei service-type ppp -----------------------------开启PPP协议

第二步:接口开启PPP PAP认证

interface Serial1/0/0

link-protocol ppp ---------------------前提条件,必须是PPP封装

ppp authentication-mode pap ----------开启PPP认证

如果被认证没有配置PPP认证,报错如下:

Aug  6 2019 21:15:12-08:00 AR1 %%01PPP/4/RESULTERR(l)[6]:On the interface Serial

1/0/0, LCP negotiation failed because the result cannot be accepted.

-----------------------------------------------------------------------

被认证方:

interface Serial1/0/0

link-protocol ppp

ppp pap local-user huawei password simple huawei  -----------发送用户名和密码到认证方

CHAP认证 ------------挑战握手认证协议

三次握手,MD5认证

单向认证配置思路:

认证方:

第一步:配置数据库------给被认证方使用

aaa

local-user huawei password cipher  huawei---------------------定义用户名和密码

local-user huawei service-type ppp -----------------------------开启PPP协议

第二步:接口开启PPP PAP认证

interface Serial1/0/0

link-protocol ppp ---------------------前提条件,必须是PPP封装

ppp authentication-mode chap ----------开启PPP认证

被认证方:

interface Serial1/0/0

link-protocol ppp

ppp  chap user  huawei -----------发送用户名给认证方

ppp  chap password  simple  huawei -----发送密码给认证方

PPPOE (PPP Over Ethernet )

工作原理:

两个阶段:

1.发现阶段

2.会话阶段

配置思路;

PPPOE服务端(不需要配置)

第一步:配置DHCP地址池

ip pool DHCP

gateway-list 172.16.1.1

network 172.16.1.0 mask 255.255.255.0

第二步:配置数据库(AAA)

aaa

local-user huawei password cipher %$%$bom7Uph7"$epS$*lH/eH62Os%$%$

local-user huawei service-type ppp

第三步:创建虚模板

interface Virtual-Template1

ppp authentication-mode chap

remote address pool DHCP

ip address 172.16.1.1 255.255.255.0 

第四步:物理接口调用

interface GigabitEthernet0/0/0

pppoe-server bind Virtual-Template 1

------------------------------------------------

客户端采用路由器

第一步: 配置拨号规则

dialer-rule

dialer-rule 1 ip permit

第二步:创建拨号接口

interface Dialer1

link-protocol ppp

ppp chap user 02554208366 ------------------------------ PPP CHAP认证

ppp chap password cipher  123456

ip address ppp-negotiate ----------------IP是协商的

dialer user test  ------------------------拨号用户名称

dialer bundle 1  ------------------------拨号绑定

第三步:物理接口调用

interface GigabitEthernet0/0/0

pppoe-client dial-bundle-number 1

第四步:检查

[AR2]display  interface  Dialer  1

Dialer1 current state : UP

Line protocol current state : UP (spoofing)

Description:HUAWEI, AR Series, Dialer1 Interface

Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)

Internet Address is negotiated, 172.16.1.254/32

Link layer protocol is PPP

LCP initial

Physical is Dialer

Current system time: 2019-08-08 20:25:07-08:00

    Last 300 seconds input rate 0 bits/sec, 0 packets/sec

    Last 300 seconds output rate 0 bits/sec, 0 packets/sec

    Realtime 0 seconds input rate 0 bits/sec, 0 packets/sec

    Realtime 0 seconds output rate 0 bits/sec, 0 packets/sec

    Input: 0 bytes

    Output:0 bytes

    Input bandwidth utilization  :    0%

    Output bandwidth utilization :    0%

Bound to Dialer1:0:

Dialer1:0 current state : UP ,

Line protocol current state : UP

Link layer protocol is PPP

LCP opened, IPCP opened

Packets statistics:

  Input packets:0,  0 bytes

  Output packets:0, 0 bytes

  FCS error packets:0

  Address error packets:0

  Control field control error packets:0

[AR2]display  pppoe-client  session  summary 

PPPoE Client Session:

ID  Bundle  Dialer  Intf            Client-MAC    Server-MAC    State

1    1      1      GE0/0/0          00e0fc7f4716  00e0fc985844  UP   

[AR2]

[AR2]display  ip int brief

*down: administratively down

^down: standby

(l): loopback

(s): spoofing

The number of interface that is UP in Physical is 3

The number of interface that is DOWN in Physical is 2

The number of interface that is UP in Protocol is 2

The number of interface that is DOWN in Protocol is 3

Interface                        IP Address/Mask      Physical  Protocol 

Dialer1                          172.16.1.254/32      up        up(s)   

GigabitEthernet0/0/0              unassigned          up        down     

GigabitEthernet0/0/1              unassigned          down      down     

GigabitEthernet0/0/2              unassigned          down      down     

NULL0                            unassigned          up        up(s)   

[AR2] e

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,402评论 6 499
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,377评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,483评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,165评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,176评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,146评论 1 297
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,032评论 3 417
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,896评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,311评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,536评论 2 332
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,696评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,413评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,008评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,659评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,815评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,698评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,592评论 2 353