一、简介

本章介绍了HDLC和PPP的基础配置方法,给出了PAP和CHAP认证的配置实例,介绍了帧中继的基础配置方法,给出了帧中继网络中的OSPF协议的配置实例。

二、WAN接入配置

2.1 原理概述

2.1.1 HDLC概述

1、高级数据链路控制HDLC(High-level Data Link Control)是一种链路层协议,运行在同步串行链路之上。HDLC最大的特点是不需要规定数据必须是字符集,对任何一种比特流,均可以实现透明的传输。 2、作为窄带通信协议的HDLC,在公网的应用逐渐消失,应用范围逐渐减小,只是在部分专网中用来封装业务数据。

2.1.2 PPP概述

1、PPP(Point-tp-Point Protocol)协议是一种数据链路层协议,主要用来在全双工的同异步链路上进行点到点之间的数据传输。PPP的设计初衷是为了两个对等节点之间的IP流量提供一种封装协议,它是在串行线IP协议SLIP(Serial Line IP)的基础上发展而来的。由于SLIP协议存在只支持异步传输方式、无协商过程、只能承载IP一种网络报文等问题,在发展过程中,逐步被PPP协议所替代。PPP是一种多协议成帧机制,适用于调制解调器。 2、PPP与HDLC的区别:HDLC是面向位的,而PPP是面向字节的。

2.1.3 串行链路概述

1、串行链路是指信息的各位数据被逐位按顺序传送的线路,适用于远距离通信,但速度较慢,与之相对的是并行链路,能够在同一时刻传送一个8bit数据。 2、同步和异步是广域网的串行链路的两种传输模式,同步模式要求通信双方以相同的时钟频率进行,通过共享单个时钟或定时脉冲源保证发送方和接收方的准确同步,效率较高;异步模式不要求双方同步,收发方可以采用各自的时钟源,双方遵循异步的通信协议,以字符为数据传输单位,发送方传送字符的时间间隔不确定,发送效率比同步模式低。

2.2 WAN接入实验

2.2.1 实验目的

1、掌握PPP的基本配置 2、掌握HDLC的基本配置 3、理解PPP与HDLC的异同

2.2.2 实验内容

本实验模拟企业网络场景。某公司开发部门的PC-1,通过部门路由器R2连接到公网出口网关R1;市场部门PC-2直连到公司出口网关;IT部门的PC-3通过部门路由器R3连接到公司出口网关。R2与R1之间链路为串行链路,封装PPP协议;R3与R1之间链路为串行链路,封装HDLC协议。R2和R3分别设置默认路由指向R1,使各部门之间可以互相访问。

2.2.3 实验拓扑

WAN接入配置实验拓扑

2.2.4 实验编址

设备 接口 IP地址 子网掩码 默认网关
R1(AR1220) S1/0/0 192.168.1.2 255.255.255.0 N/A
R1(AR1220) S1/0/1 192.168.2.2 255.255.255.0 N/A
R1(AR1220) E2/0/1 172.16.2.254 255.255.255.0 N/A
R2(AR1220) S1/0/0 192.168.1.1 255.255.255.0 192.168.1.2
R2(AR1220) E2/0/1 172.16.1.254 255.255.255.0 192.168.1.2
R3(AR1220) S1/0/1 192.168.2.1 255.255.255.0 192.168.2.2
R3(AR1220) E2/0/1 172.16.3.254 255.255.255.0 192.168.2.2
PC-1 E0/0/1 172.16.1.1 255.255.255.0 172.16.1.254
PC-2 E0/0/1 172.16.2.1 255.255.255.0 172.16.2.254
PC-3 E0/0/1 172.16.3.1 255.255.255.0 172.16.3.254
### 2.2.5 实验步骤
#### 2.2.5.1 基本配置
根据实验编制表进行相应的基本配置,并使用Ping命令检测直连链路的连通性。
#### 2.2.5.2 配置PPP
1、在R2上配置默认路由指向出口网关路由器R1,并在R1上配置目的网段为PC-1所在网络的静态路由,下一跳路由器为R2。
[R2]ip route-static 0.0.0.0 0 192.168.1.2
[R1]ip route-static 172.16.1.0 24 192.168.1.1

注意:默认情况下,串行接口封装的链路层协议为PPP!!! 2、配置完成后,测试PC-1和R1的连通性。观察到连通性正常。

PC-1>ping 192.168.1.2

Ping 192.168.1.2: 32 data bytes, Press Ctrl_C to break
From 192.168.1.2: bytes=32 seq=1 ttl=254 time=47 ms
From 192.168.1.2: bytes=32 seq=2 ttl=254 time=16 ms
From 192.168.1.2: bytes=32 seq=3 ttl=254 time=16 ms
From 192.168.1.2: bytes=32 seq=4 ttl=254 time=15 ms
From 192.168.1.2: bytes=32 seq=5 ttl=254 time=16 ms

--- 192.168.1.2 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 15/22/47 ms

注意:默认情况下,串行接口封装的链路层协议为PPP!!!

2.2.5.3 配置HDLC

1、在R1和R3的S1/0/1接口上分别使用****命令配置链路层协议为HDLC。

[R1]int s1/0/1  
[R1-Serial1/0/1]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y

[R3]int s1/0/1  
[R3-Serial1/0/1]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y

2、在R3上配置默认路由指向出口网关路由器R1,并在R1上配置目的网段为PC-3所在网络的静态路由,下一跳路由器为R3连接R1的S1/0/1接口。

[R1]ip route-static 172.16.3.0 24 Serial 1/0/1

[R3]ip route-static 0.0.0.0 0 Serial 1/0/1

3、配置完成后,在PC-3上测试与路由器R1间的连通性。观察到可以正常通信。

PC-3>ping 192.168.2.2

Ping 192.168.2.2: 32 data bytes, Press Ctrl_C to break
From 192.168.2.2: bytes=32 seq=1 ttl=254 time=47 ms
From 192.168.2.2: bytes=32 seq=2 ttl=254 time=31 ms
From 192.168.2.2: bytes=32 seq=3 ttl=254 time=16 ms
From 192.168.2.2: bytes=32 seq=4 ttl=254 time=16 ms
From 192.168.2.2: bytes=32 seq=5 ttl=254 time=31 ms

--- 192.168.2.2 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 16/28/47 ms

2.3 思考

假设在某一直连链路上,一端接口的链路层协议为PPP,另一端为HDLC,此时能否正常通信? 答:不能,数据链路封装不同,在设备接口收到数据帧时,由于对帧的封装协议不同,设备会丢掉数据报文。

三、PPP的认证

3.1 原理概述

PPP协议之所以能成为广域网中应用较为广泛的协议,原因之一就是它能提供验证协议CHAP(Challenge-Handshake Authentication Protocol,挑战式握手协议)、PAP(Password Authentication Protocol,密码验证协议),更好地保证了网络安全性。

3.1.1 PAP概述

PAP为两次握手验证,口令为明文,验证过程仅在链路初始建立阶段进行。当链路建立阶段结束后,用户名和密码将由被验证方重复地在链路上发送给验证方,直到验证方通过或中止连接。PAP不是一种安全的验证协议,因为口令是以明文方式在链路上发送的,并且用户名和口令还会被验证方不停地在链路上反复发送,导致很容易被截获。

3.1.2 CHAP概述

CHAP是三次握手验证协议,只在网络上传输用户名,而不是传输用户名密码,因此安全性要比PAP高。CHAP协议是在链路建立开始就完成的,在链路建立完成后的任何时间可以进行再次验证。当链路建立阶段完成后,验证方发送一个"challenge"报文给被验证方;被验证方经过一次Hash算法后,给验证方返回一个值;验证方把自己经过Hash算法生成的值和被验证方返回的值进行比较。如果两者匹配,那么验证通过,否则验证不通过,连接被终止。

3.2 PPP认证实验

3.2.1 实验目的

1、掌握配置PPP PAP认证的方法 2、掌握配置PPP CHAP认证的方法 3、理解PPP PAP认证与CHAP认证的区别

3.2.2 实验内容

本实验模拟企业网络环境。R1为分支机构接入端网关设备,PC-1为企业分支机构终端。R2为企业总部接入终端网关设备,PC-2为企业总部终端,R3为企业总部核心路由器。出于安全角度考虑,网络管理员在分支机构访问总部时部署PPP认证,R1为被认证方路由器,R3为认证方路由器,只有认证通过才能建立PPP连接进行正常访问。

3.2.3 实验拓扑

PPP认证实验拓扑

3.2.4 实验编址

设备 接口 IP地址 子网掩码 默认网关
PC-1 E0/0/1 10.0.1.1 255.255.255.0 10.0.1.254
PC-1 E0/0/1 10.0.2.1 255.255.255.0 10.0.2.254
R1(AR2220) GE0/0/0 10.0.1.254 255.255.255.0 N/A
R1(AR2220) S4/0/0 10.0.13.1 255.255.255.0 N/A
R2(AR2220) GE0/0/1 10.0.2.254 255.255.255.0 N/A
R2(AR2220) GE0/0/0 10.0.23.2 255.255.255.0 N/A
R3(AR2220) GE0/0/0 10.0.23.3 255.255.255.0 N/A
R3(AR2220) S4/0/0 10.0.13.3 255.255.255.0 N/A
### 3.2.5 实验步骤
#### 3.2.5.1 基本配置
根据实验编制表进行相应的基本配置,并使用Ping命令检测直连链路的连通性。
#### 3.2.5.2 搭建OSPF网络
1、在每台路由器上配置OSPF协议,并通告相应网段到区域0内。
[R1]ospf
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.1.0 0.0.0.255  
[R1-ospf-1-area-0.0.0.0]network 10.0.13.0 0.0.0.255

[R2]ospf 
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.0.23.0 0.0.0.255

[R3]ospf 
[R3-ospf-1]area 0   
[R3-ospf-1-area-0.0.0.0]network 10.0.13.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.0.23.0 0.0.0.255

2、配置完成后测试总部与分支终端间的连通性。观察到通信正常。

PC-1>ping 10.0.2.1

Ping 10.0.2.1: 32 data bytes, Press Ctrl_C to break
From 10.0.2.1: bytes=32 seq=1 ttl=125 time=31 ms
From 10.0.2.1: bytes=32 seq=2 ttl=125 time=31 ms
From 10.0.2.1: bytes=32 seq=3 ttl=125 time=32 ms
From 10.0.2.1: bytes=32 seq=4 ttl=125 time=31 ms
From 10.0.2.1: bytes=32 seq=5 ttl=125 time=31 ms

--- 10.0.2.1 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/31/32 ms

3.2.5.3 配置PPP的PAP认证

1、为提升分支机构与总部通信的安全性,在分支网关设备R1与公司核心设备R3上部署PPP的CHAP认证。R3作为认证路由器,R1作为被认证路由器。在总部设备R3上使用ppp authentication-mode pap domain huawei 命令设置本端的PPP协议对对端设备的认证方式为PAP,认证采用的域名为huawei。

[R3]int s4/0/0
[R3-Serial4/0/0]ppp authentication-mode pap domain huawei 

2、配置认证路由器R3的本地认证信息,执行aaa命令,进入AAA视图。

[R3]aaa
[R3-aaa]

3、使用authentication-scheme huawei_1命令配置域的认证方案为huawei_1,并进入认证方案视图。

[R3-aaa]authentication-scheme huawei_1
Info: Create a new authentication scheme.

4、使用authorization-mode local命令配置认证模式为本地认证。

[R3-aaa-author-huawei_1]authorization-mode local

注意:认证模式默认就是本地认证,所以这一步骤可以省略!!! 5、在AAA试图下,使用domain huaweiyu命令创建域huaweiyu,并进入域视图

[R3-aaa]domain huaweiyu
Info: Success to create a new domain.

6、在域视图下,使用****命令配置域的认证方案为huawei_1.

[R3-aaa-domain-huaweiyu]authorization-scheme huawei_1 

注意:必须和创建的认证方案一致!!! 7、在AAA视图下,使用local-user R1@huaweiyu password cipher Huawei 命令存储在本地,为对端认证方所使用的用户名为R1@huaweiyu,密码为Huawei.

[R3-aaa]local-user R1@huaweiyu password cipher Huawei 
Info: Add a new user.
[R3-aaa]local-user R1@huaweiyu service-type ppp

8、配置完成后,关闭R1与R3相连接口一段时间后再打开,使R1和R3间的链路重新协商,并检查链路状态和连通性。观察到R1和R3之间无法互相通信,这是因为此时PPP链路上的PAP认证未通过。

[R3]int s4/0/0
[R3-Serial4/0/0]shutdown
[R3-Serial4/0/0]undo shutdown

<R1>dis ip int bri 
*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 3
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 4

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              10.0.1.254/24        up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       10.0.13.1/24         up         down      
Serial4/0/1                       unassigned           down       down 

[R3]ping 10.0.13.1
  PING 10.0.13.1: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 10.0.13.1 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

9、在R1的S4/0/0接口下,使用ppp pap local-user R1@huaweiyu password cipher Huawei命令配置本端被对端以PAP方式验证时本地发送的PAP用户名和密码。

[R1]int s4/0/0
[R1-Serial4/0/0]ppp pap local-user R1@huaweiyu password cipher Huawei

10、配置完成后,再次查看链路状态并测试连通性。观察到,现在R1与R3之间的链路层状态正常,并且可以正常通信。

[R1]dis 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 3
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              10.0.1.254/24        up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       10.0.13.1/24         up         up        
Serial4/0/1                       unassigned           down       down 

[R1]ping 10.0.13.3
  PING 10.0.13.3: 56  data bytes, press CTRL_C to break
    Reply from 10.0.13.3: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 10.0.13.3: bytes=56 Sequence=2 ttl=255 time=40 ms
    Reply from 10.0.13.3: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.0.13.3: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 10.0.13.3: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 10.0.13.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/32/40 ms

11、测试PC-1与PC-2的连通性。观察到总部与分支间的终端通信正常。

PC-1>ping 10.0.2.1

Ping 10.0.2.1: 32 data bytes, Press Ctrl_C to break
From 10.0.2.1: bytes=32 seq=1 ttl=125 time=16 ms
From 10.0.2.1: bytes=32 seq=2 ttl=125 time=31 ms
From 10.0.2.1: bytes=32 seq=3 ttl=125 time=31 ms
From 10.0.2.1: bytes=32 seq=4 ttl=125 time=16 ms
From 10.0.2.1: bytes=32 seq=5 ttl=125 time=47 ms

--- 10.0.2.1 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 16/28/47 ms

3.2.5.4 配置PPP的CHAP认证

1、由于PPP认证密码经常被盗用,遂对网络状况进行分析。抓取R1的S4/0/0/数据包进行分析。观察到,在数据包中很容易找到所配置的用户名和密码。"Peer-ID"显示内容为用户名,"Password"显示内容为密码,可以查看具体内容。 PPP认证实验——PAP认证抓包观察

2、为进一步提高链路安全性,网络管理员需要重新部署PPP的CHAP认证。首先删除原有PAP认证配置,域名保持不变。

[R3]int s4/0/0
[R3-Serial4/0/0]undo ppp authentication-mode 

[R1]int s4/0/0
[R1-Serial4/0/0]undo ppp pap local-user 

3、删除后,在认证设备R3的S4/0/0接口下配置PPP的认证方式为CHAP。

[R3]int s4/0/0
[R3-Serial4/0/0]ppp authentication-mode chap

4、配置存储在本地,对端认证方所使用的用户名为R1,密码为huawei。

[R3]aaa
[R3-aaa]local-user R1 password cipher huawei
[R3-aaa]local-user R1 service-type ppp

5、其他认证方案和域的配置保持不变。 6、配置完成后,关闭R3的S4/0/0后再重新打开,使链路重新协商。查看链路状态,并测试连通性。观察到,目前R1与R3间的链路层协议状态不正常,无法正常通信。

[R3]int s4/0/0
[R3-Serial4/0/0]shutdown
[R3-Serial4/0/0]undo shutdown

[R3]dis ip int bri 
*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 3
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 4

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              10.0.23.3/24         up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       10.0.13.3/24         up         down      
Serial4/0/1                       unassigned           down       down  

[R3]ping 10.0.13.1
  PING 10.0.13.1: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 10.0.13.1 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

7、在R1的S4/0/0接口下配置CHAP认证的用户名和密码

[R1]int s4/0/0
[R1-Serial4/0/0]ppp chap user R1
[R1-Serial4/0/0]ppp chap password cipher huawei

8、配置完成后,测试R1与R3的连通性。观察到R1与R3的通信正常。

[R3]ping 10.0.13.1
  PING 10.0.13.1: 56  data bytes, press CTRL_C to break
    Reply from 10.0.13.1: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 10.0.13.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 10.0.13.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.0.13.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.0.13.1: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 10.0.13.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/24/30 ms

9、测试分支PC-1和总部PC-2间的连通性。观察到,连通性正常。

PC-1>ping 10.0.2.1

Ping 10.0.2.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.0.2.1: bytes=32 seq=2 ttl=125 time=32 ms
From 10.0.2.1: bytes=32 seq=3 ttl=125 time=31 ms
From 10.0.2.1: bytes=32 seq=4 ttl=125 time=16 ms
From 10.0.2.1: bytes=32 seq=5 ttl=125 time=31 ms

--- 10.0.2.1 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/27/32 ms

10、继续在R1的S4/0/0接口下抓包观察,观察到数据包内容已经为加密方式发送,无法被攻击者截获认证密码。

PPP认证实验——CHAP认证抓包观察

3.3 思考

当PPP链路UP后,在PPP链路一端加上认证配置而另一端不加,为什么一定要重启端口后认证才能生效? 答:PPP认证协商发生在PPP会话建立阶段,当PPP会话成功建立后,PPP链路将一直保持通信,不再更改协商的参数直至关闭这条链路的连接。只有关闭连接后重新建立会话才会重新协商参数,认证方式的更改才能生效。

四、帧中继基本配置

4.1 原理概述

1、帧中继(Frame Relay)是一种面向连接的数据链路层技术,主要用于在公共或专用网上的局域网互联以及广域网连接。 2、帧中继协议是一种简化X.25的广域网协议,它在控制层面上提供虚电路的管理、带宽管理和防止阻塞等功能。在传送数据时使用的传输链路是逻辑连接,而不是物理连接。在一个物理连接上可以复用多个逻辑连接,实现带宽的复用和动态分配,帧透明传输和错误检测,但不提供重传操作。与传统的电路交换相比,帧中继网络有利于多用户、多速率数据的传输,也充分利用了网络资源。 3、帧中继网络的两端的设备用虚电路来连接。每条虚电路是用数据链路连接标识符定义的一条帧中继连接通道,提供了用户设备(如路由器和主机等)之间进行数据通信的能力。

4.1.1 帧中继网络相关术语

4.1.1.1 DTE(Data Terminal Equipment,数据终端设备)

通常指用户侧的主机或终端等

4.1.1.2 DCE(Data Circuit-terminating Equipment,数据电路终结设备)

为用户设备提供接入的设备,属于网络设备,如帧中继交换机

虚链路接口的标识。帧中继能够在单一物理传输线路上提供多条虚电路,虚电路通过DLCL来区分

4.1.1.4 PVC(Permanent Virtual Circuit,永久虚电路)

永久虚电路是指给用户提供固定的虚电路,该电路一旦建立,则链路永远生效,除非管理员手动删除。PVC用于两端之间频繁的、流量稳定的数据传输。

4.1.1.5 逆向地址解析协议(Inverse ARP)

主要功能是求解每条虚电路连接的对端设备的IP地址。如果知道了某条虚电路连接的对端设备的IP协议地址,在本地就可以生成对端IP地址与DLCI的映射(MAP),从而避免手工配置映射。

4.1.2 实验目的

1、掌握帧中继交换机的配置 2、掌握动态映射的配置 3、掌握静态映射的配置 4、掌握子接口和DLCI的映射配置

4.1.3 实验内容

本实验模拟企业网络场景。公司A的总部和分部分别设在不同地方,总部路由器R1和分部路由器R2通过帧中继网络相连,总部与分部之间申请了一条PVC。由于业务的发展,公司A与公司B有了密切来往,公司B路由器R3也采用帧中继并使用动态映射方式与公司A相连,即只能与公司A总部直接通信。现需要采用帧中继子接口配置和静态路由使R3能通过R1访问R2,实现全网全通。

4.1.4 实验拓扑

帧中继基本配置实验拓扑

4.1.5 实验编址

| 设备 | 接口 | IP地址 | 子网掩码 | 默认网关 |DLCI |---|---|---|---|---| | R1(AR1220) | S1/0/0 | 11.1.1.1 | 255.255.255.0 | N/A | 102 | R1(AR1220) | S1/0/0.1 | 22.1.1.1 | 255.255.255.0 | N/A | 103 | R2(AR1220) | S1/0/0 | 11.1.1.2 | 255.255.255.0 | N/A | 201 | R3(AR1220) | S1/0/0 | 22.1.1.3 | 255.255.255.0 | N/A | 301

4.1.6 实验步骤

4.1.6.1 基本配置

根据实验编制表进行相应的基本配置,并使用Ping命令检测直连链路的连通性。

4.1.6.2 配置PVC

1、在帧中继交换机上建立一条PVC,这条PVC在S0/0/1接口上分配DLCI为102,在S0/0/2接口上分配DLCI为201,二者同属于一条PVC。 2、在帧中继交换机上建立另一条PVC,这条PVC在S0/0/1接口上分配DLCI为103,在S0/0/3接口上分配DLCI 301,二者属于另一条PVC。

4.1.6.3 静态与动态映射的配置

1、公司总部A使用动态映射,在R1的S1/0/0接口配置链路层协议为FR,并使用fr inarp命令允许帧中继逆向地址解析功能自动生成地址映射表。

[R1]int s1/0/0
[R1-Serial1/0/0]link-protocol fr 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[R1-Serial1/0/0]fr inarp

注意:默认情况下,串行接口使用的链路层协议为PPP协议。帧中继接口的逆向地址解析功能默认是开启的,所以fr inarp命令可以不配置!!! 2、公司A分部由于只需要与总部通信即可,使用静态映射,在RR2的S1/0/0接口下配置链路层协议为FR,关闭逆向解析功能,使用fr map ip命令手工配置R1的IP地址与DLCI的静态映射。

[R2]int s1/0/0
[R2-Serial1/0/0]link-protocol fr 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[R2-Serial1/0/0]undo fr inarp
[R2-Serial1/0/0]fr map ip 11.1.1.1 201 broadcast 

注意:默认情况下,帧中继不支持广播或组播数据的转发。如果需要在帧中继上运行一些动态路由协议,需要在静态映射后面添加broadcast参数,从而使PVC能够正常发送来自路由协议的广播或组播流量。 3、配置完成后,在R1和R2上使用display fr pvc-info命令查看PVC的建立情况。观察到R1有两条PVC,而且都为激活状态。R2的PVC也为激活状态。

<R1>dis fr pvc-info 
PVC statistics for interface Serial1/0/0 (DTE, physical UP) 
    DLCI = 102, USAGE = UNUSED (00000000), Serial1/0/0
    create time = 2022/02/14 09:29:36, status = ACTIVE
    InARP = Enable, PVC-GROUP = NONE
    in packets = 2, in bytes = 257698037760
    out packets = 78, out bytes = 2340

    DLCI = 103, USAGE = UNUSED (00000000), Serial1/0/0
    create time = 2022/02/14 09:29:36, status = ACTIVE
    InARP = Enable, PVC-GROUP = NONE
    in packets = 0, in bytes = 0
    out packets = 77, out bytes = 2310

[R2]dis fr pvc-info 
PVC statistics for interface Serial1/0/0 (DTE, physical UP) 
    DLCI = 201, USAGE = LOCAL (00000100), Serial1/0/0
    create time = 2022/02/14 10:32:25, status = ACTIVE
    InARP = Disable, PVC-GROUP = NONE
    in packets = 14, in bytes = 1803886264320
    out packets = 2, out bytes = 60

4、测试R1和R2之间的连通性。

<R1>ping 11.1.1.2 
  PING 11.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 11.1.1.2: bytes=56 Sequence=1 ttl=255 time=70 ms
    Reply from 11.1.1.2: bytes=56 Sequence=2 ttl=255 time=40 ms
    Reply from 11.1.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 11.1.1.2: bytes=56 Sequence=4 ttl=255 time=10 ms
    Reply from 11.1.1.2: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 11.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/34/70 ms

4.1.6.4 子接口配置和静态路由

1、由于业务需要,公司B和公司A互相通信。公司B和公司A总部之间互连IP网段使用22.1.1.0/24。在R3的S1/0/0接口配置链路层协议为FR,并保持默认开启的逆向地址解析功能。

[R3]int s1/0/0
[R3-Serial1/0/0]ip add 22.1.1.3 24  
[R3-Serial1/0/0]link-protocol fr 

2、配置完成后,在R3上使用dis fr pvc-info命令查看PVC建立的情况。观察到,此时R3的PVC已经激活。

[R3]dis fr pvc-info
PVC statistics for interface Serial1/0/0 (DTE, physical UP) 
    DLCI = 301, USAGE = UNUSED (00000000), Serial1/0/0
    create time = 2022/02/14 13:56:38, status = ACTIVE
    InARP = Enable, PVC-GROUP = NONE
    in packets = 3, in bytes = 386547056640
    out packets = 3, out bytes = 90

3、为实现与R3的互相通信,需要在R1上创建子接口S1/0/0.1,配置与R3同网段的IP地址,并手工指定本地DLCI配置虚电路。

[R1]int s1/0/0.1 
[R1-Serial1/0/0.1]ip add 22.1.1.1 24
[R1-Serial1/0/0.1]fr dlci 103 

默认情况下,帧中继交换机分配的DLCI都关联到用户设备的物理接口上,而子接口关联的DLCI需手工指定!!! 4、配置完成后,测试R1与R3间能否正常通信。观察到通信正常。

[R3]ping 22.1.1.1
  PING 22.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 22.1.1.1: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 22.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 22.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 22.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 22.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 22.1.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/28/50 ms

5、测试R2和R3间能否正常通信,观察到无法正常通信。这是因为R2和R3不在同一个网段,需要有到达对方的路由才能连通。

[R3]ping 11.1.1.2
  PING 11.1.1.2: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 11.1.1.2 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

6、为了使R2和R3能够正常通信,在R3上配置静态路由,目的地址为R2,下一跳地址为R1的子接口地址;同样在R2上配置静态路由,目的地址为R3,下一跳地址为R1的S1/0/0接口地址。

[R2]ip route-static 22.1.1.3 32 11.1.1.1
[R3]ip route-static 11.1.1.2 32 22.1.1.1

7、再次测试R2与R3之间的连通性。观察到连通性正常。

[R3]ping 11.1.1.2
  PING 11.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 11.1.1.2: bytes=56 Sequence=1 ttl=254 time=60 ms
    Reply from 11.1.1.2: bytes=56 Sequence=2 ttl=254 time=30 ms
    Reply from 11.1.1.2: bytes=56 Sequence=3 ttl=254 time=40 ms
    Reply from 11.1.1.2: bytes=56 Sequence=4 ttl=254 time=20 ms
    Reply from 11.1.1.2: bytes=56 Sequence=5 ttl=254 time=30 ms

  --- 11.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/36/60 ms

8、使用tracert命令查看路径,观察到,R3去往R2的流量经过了R1。

[R3]tracert 11.1.1.2

 traceroute to  11.1.1.2(11.1.1.2), max hops: 30 ,packet length: 40,press CTRL_C
 to break 

 1 22.1.1.1 20 ms  10 ms  20 ms 

 2 11.1.1.2 10 ms  20 ms  20 ms 

4.2 思考

帧中继中动态映射的过程是怎么样的?它和ARP机制的区别在哪里? 答:(1) 帧中继基本配置实验——思考题图

A首先发送单播消息请求其对应目的硬件IP地址是多少,同时在广播消息中还附带自己的IP地址。 B接收到该广播包后,修改该请求数据包,从帧中继帧头中提取硬件地址放入请求包的源硬件地址域中,即可形成A的地址映射。然后形成单播响应,响应包中包含B的IP地址以及A的IP地址和硬件地址。 A收到响应,修改响应数据包,从帧中继帧头中取出硬件地址放入响应数据包的源硬件地址域中,然后将其添加到地址映射表中。之后设备A和B就可以正常进行数据传送了。 (2) ARP用于已知本端IP地址和硬件地址以及对端IP地址的情况下,求解对端的MAC地址,其工作原理如下: A首先发送广播信息请求其对应目的IP地址的硬件地址是多少,同时在该广播消息中还附带自己的IP地址和硬件地址。 B接收到该广播包后,取出A的IP地址和硬件地址,将其添加到地址映射表中。同时返回单播响应,响应包中包含B的IP地址和硬件地址。 A收到响应包后,取出B的IP地址和硬件地址,将其添加到地址映射表中。之后设备A和B就可以正常进行数据传送了。 Inverse ARP用于帧中继网络中IP地址和虚电路号的映射关系的动态维护。其工作原理如下: A首先发送单播信息请求其对应目的硬件地址的IP地址是多少,同时在该广播消息中还附带自己的IP地址。 B接收到该广播包后,修改该请求数据包,从帧中继帧头中提取硬件地址放入请求包的源硬件地址域中,即可形成A的地址映射。然后形成单播响应,响应包中包含B的IP地址以及A的IP地址和硬件地址。 A收到响应,修改响应数据包,从帧中继帧头中取出硬件地址放入响应数据包的源硬件地址域中,然后将其添加到地址映射表中。之后设备A和B就可以正常进行数据传送了。

五、OSPF在帧中继网络中的配置

5.1 原理概述

OSPF将网络分为4种不同的类型,即Point-to-Point、Broadcast、NBMA及Point-to-MultiPoint,不同网络类型下OSPF的工作机制不一样。比如,在Broadcast网络中,OSPD能够直接建立邻居邻接关系;在NBMA网络中默认手工指定邻居等。在实际网络中,可通过配置接口的网络类型来强制改变默认的接口的网络类型。在帧中继环境中,OSPF默认的网络类型是NBMA。

5.2 OSPF在帧中继网络配置实验

5.2.1 实验目的

1、掌握OSPF在帧中继网络中的配置方法 2、理解Hub-Spoke组网架构 3、掌握在帧中继网络中排除OSPF故障的方法

5.2.2 实验内容

某公司的网络使用OSPF协议,该公司由一个总部和两个分支机构组成。R1为总部路由器,R2和R3分别是两个分支机构的出口路由器。两分支机构都是通过租用运营商的帧中继虚电路来与总部通信的。但为了节省成本,两个分支机构间没有直接互联的虚电路,即典型的Hub-Spoke组网架构,R1为Hub端设备,R2、R3为Spoke端设备。

5.2.3 实验拓扑

OSPF帧中继网络配置实验拓扑

5.2.4 实验编址

| 设备 | 接口 | IP地址 | 子网掩码 | 默认网关 |DLCI |---|---|---|---|---| | R1(AR2220) | Loopback0 | 10.1.1.1 | 255.255.255.255 | N/A | N/A | R1(AR2220) | S1/0/0 | 10.0.123.1 | 255.255.255.0 | N/A | 102/103 | R2(AR2220) | Loopback0 | 10.1.2.2 | 255.255.255.255 | N/A | N/A | R2(AR2220) | S1/0/0 | 10.0.123.2 | 255.255.255.0 | N/A | 201 | R3(AR2220) | Loopback0 | 10.1.3.3 | 255.255.255.255 | N/A | N/A | R3(AR2220) | S1/0/0 | 10.0.123.3 | 255.255.255.0 | N/A | 301

5.2.5 实验步骤

5.2.5.1 基本配置

1、首先根据实验编址表进行相应的基本IP地址配置,并配置帧中继静态地址映射。环回接口的掩码为32位,用来模拟公司总部和分部的主机。注意将R1设置为DR,调整其DR优先级为100。(DR优先级默认为1)

[R1]int s1/0/0
[R1-Serial1/0/0]li  
[R1-Serial1/0/0]link-protocol fr 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[R1-Serial1/0/0]ip address 10.0.123.1 24
[R1-Serial1/0/0]undo fr inarp 
[R1-Serial1/0/0]fr map ip 10.0.123.2 102
[R1-Serial1/0/0]fr map ip 10.0.123.3 103
[R1-Serial1/0/0]ospf dr-priority 100
[R1-Serial1/0/0]int loop 0
[R1-LoopBack0]ip add 10.1.1.1 32

[R2]int s1/0/0
[R2-Serial1/0/0]link-protocol fr 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[R2-Serial1/0/0]ip add 10.0.123.2 24
[R2-Serial1/0/0]undo fr inarp
[R2-Serial1/0/0]fr map ip 10.0.123.1 201 
[R2-Serial1/0/0]int loop 0
[R2-LoopBack0]ip add 10.2.2.2 32

[R3]int s1/0/0
[R3-Serial1/0/0]ip add 10.0.123.3 24
[R3-Serial1/0/0]link-protocol fr 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y 
[R3-Serial1/0/0]fr map ip 10.0.123.1 301 
[R3-Serial1/0/0]undo fr inarp
[R3-Serial1/0/0]int loop 0
[R3-LoopBack0]ip add 10.3.3.3 32

2、配置完成后,检查帧中继的虚电路状态和映射表。可以观察到,PVC处于ACTIVE状态正常。

[R1]dis fr pvc-info
PVC statistics for interface Serial1/0/0 (DTE, physical UP) 
    DLCI = 102, USAGE = LOCAL (00000100), Serial1/0/0
    create time = 2022/02/14 16:15:21, status = ACTIVE
    InARP = Disable, PVC-GROUP = NONE
    in packets = 0, in bytes = 0
    out packets = 0, out bytes = 0

    DLCI = 103, USAGE = LOCAL (00000100), Serial1/0/0
    create time = 2022/02/14 16:15:28, status = ACTIVE
    InARP = Disable, PVC-GROUP = NONE
    in packets = 0, in bytes = 0
    out packets = 0, out bytes = 0

[R1]dis fr map-info 
Map Statistics for interface Serial1/0/0 (DTE)
  DLCI = 102, IP 10.0.123.2, Serial1/0/0
    create time = 2022/02/14 16:15:21, status = ACTIVE
    encapsulation = ietf, vlink = 1
  DLCI = 103, IP 10.0.123.3, Serial1/0/0
    create time = 2022/02/14 16:15:28, status = ACTIVE
    encapsulation = ietf, vlink = 2

3、检查R1和R2,R1和R3间的连通性。此时通信正常。

[R1]ping 10.0.123.2
  PING 10.0.123.2: 56  data bytes, press CTRL_C to break
    Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 10.0.123.2: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 10.0.123.2: bytes=56 Sequence=3 ttl=255 time=40 ms
    Reply from 10.0.123.2: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 10.0.123.2: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 10.0.123.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/36/50 ms

[R1]ping 10.0.123.3
  PING 10.0.123.3: 56  data bytes, press CTRL_C to break
    Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 10.0.123.3: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 10.0.123.3: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.0.123.3: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.0.123.3: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 10.0.123.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/26/50 ms

5.2.5.2 在帧中继上搭建OSPF网络

1、在R1、R2、R3上配置OSPF协议。指定各自的环回接口地址作为Router-id,所有网段都属于区域0.

[R1]ospf router-id 10.1.1.1 
[R1-ospf-1]area 0 
[R1-ospf-1-area-0.0.0.0]network 10.0.123.0 0.0.0.255 
[R1-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0

[R2]ospf router-id 10.2.2.2 
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.123.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.2.2.2 0.0.0.0

[R3]ospf router-id 10.3.3.3 
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.123.0 0.0.0.255    
[R3-ospf-1-area-0.0.0.0]network 10.3.3.3 0.0.0.0

2、配置完成后,查看OSPF的邻居建立情况。发现无法正常建立邻居。需要立刻进行分析排查故障。

[R1]dis ospf peer brief 

     OSPF Process 1 with Router ID 10.1.1.1
          Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 ----------------------------------------------------------------------------

排查故障的时候需要注意遵循从底层逐步往上层排查的顺序,即先检查物理层线缆是否正常,然后检查二层链路的连通性,再检查三层路由协议的运行情况,最后检查高层相关应用是否正常!!! 3、物理层检查这里省略,首先测试直连线路的连通性。观察到连通性正常。

<R1>ping 10.0.123.2
  PING 10.0.123.2: 56  data bytes, press CTRL_C to break
    Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 10.0.123.2: bytes=56 Sequence=2 ttl=255 time=40 ms
    Reply from 10.0.123.2: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 10.0.123.2: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 10.0.123.2: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 10.0.123.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/34/40 ms

<R1>ping 10.0.123.3
  PING 10.0.123.3: 56  data bytes, press CTRL_C to break
    Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 10.0.123.3: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 10.0.123.3: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 10.0.123.3: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.0.123.3: bytes=56 Sequence=5 ttl=255 time=40 ms

  --- 10.0.123.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/32/50 ms

4、查看三层路由协议,即相应接口是否被通告到OSPF进程中。观察到所有接口都已经被通告进入OSPF进程。

<R1>dis ospf interface 

     OSPF Process 1 with Router ID 10.1.1.1
         Interfaces 

 Area: 0.0.0.0          (MPLS TE not enabled)
 IP Address      Type         State    Cost    Pri   DR              BDR 
 10.0.123.1      NBMA         DR       48      100   10.0.123.1      0.0.0.0
 10.1.1.1        P2P          P-2-P    0       1     0.0.0.0         0.0.0.0

<R2>dis ospf interface 

     OSPF Process 1 with Router ID 10.2.2.2
         Interfaces 

 Area: 0.0.0.0          (MPLS TE not enabled)
 IP Address      Type         State    Cost    Pri   DR              BDR 
 10.2.2.2        P2P          P-2-P    0       1     0.0.0.0         0.0.0.0
 10.0.123.2      NBMA         DR       48      1     10.0.123.2      0.0.0.0

<R3>dis ospf interface 

     OSPF Process 1 with Router ID 10.3.3.3
         Interfaces 

 Area: 0.0.0.0          (MPLS TE not enabled)
 IP Address      Type         State    Cost    Pri   DR              BDR 
 10.3.3.3        P2P          P-2-P    0       1     0.0.0.0         0.0.0.0
 10.0.123.3      NBMA         DR       48      1     10.0.123.3      0.0.0.0

5、对R1的S1/0/0接口进行抓包分析,查看协议的运行情况。发现R1始终没有向外发送OSPF数据包。这是由于OSPF在帧中继上默认的网络类型为NBMA,即非广播多路访问。这种网络类型的特点是不支持组播和广播的数据包,而OSPF协议默认是采用组播方式发送报文,所有设备的OSPF报文无法在帧中继链路上进行发送,导致没有成功建立邻居关系。

OSPF帧中继网络配置实验——R1抓包观察

6、采用peer命令手工指定OSPF邻居,采用单播方式发送报文。

[R1]ospf 
[R1-ospf-1]peer 10.0.123.2
[R1-ospf-1]peer 10.0.123.3

[R2]ospf 
[R2-ospf-1]peer 10.0.123.1

[R3]ospf 
[R3-ospf-1]peer 10.0.123.1

7、配置完成后,再次查看OSPF的邻居关系状态。观察到R1和R2、R3都建立了邻接关系。

[R1]dis ospf peer brief 

     OSPF Process 1 with Router ID 10.1.1.1
          Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          Serial1/0/0                      10.2.2.2         Full        
 0.0.0.0          Serial1/0/0                      10.3.3.3         Full        
 ----------------------------------------------------------------------------

8、再查看R1、R2和R3的路由表。观察到此时R1、R2和R3路由表中都互相接收到了各自环回口所在网段的路由条目。

[R1]dis ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 2        Routes : 2        

OSPF routing table status : <Active>
         Destinations : 2        Routes : 2

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       10.2.2.2/32  OSPF    10   48          D   10.0.123.2      Serial1/0/0
       10.3.3.3/32  OSPF    10   48          D   10.0.123.3      Serial1/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R2]dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 2        Routes : 2        

OSPF routing table status : <Active>
         Destinations : 2        Routes : 2

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       10.1.1.1/32  OSPF    10   48          D   10.0.123.1      Serial1/0/0
       10.3.3.3/32  OSPF    10   48          D   10.0.123.3      Serial1/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R3]dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 2        Routes : 2        

OSPF routing table status : <Active>
         Destinations : 2        Routes : 2

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       10.1.1.1/32  OSPF    10   48          D   10.0.123.1      Serial1/0/0
       10.2.2.2/32  OSPF    10   48          D   10.0.123.2      Serial1/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

9、测试R1与R2、R1与R3环回口之间的连通性。观察到连通性正常。

[R1]ping -a 10.1.1.1 10.2.2.2 
  PING 10.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 10.2.2.2: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 10.2.2.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 10.2.2.2: bytes=56 Sequence=3 ttl=255 time=40 ms
    Reply from 10.2.2.2: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 10.2.2.2: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 10.2.2.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/26/40 ms

[R1]ping -a 10.1.1.1 10.3.3.3
  PING 10.3.3.3: 56  data bytes, press CTRL_C to break
    Reply from 10.3.3.3: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 10.3.3.3: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 10.3.3.3: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.3.3.3: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.3.3.3: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 10.3.3.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/28/40 ms

10、测试R2与R3环回口之间的连通性。观察到连通性异常。

<R2>ping -a 10.2.2.2 10.3.3.3
  PING 10.3.3.3: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 10.3.3.3 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

11、需要再次进行排除障碍,首先检查物理链路状态。观察到物理链路状态正常。

<R2>ping 10.0.123.1 
  PING 10.0.123.1: 56  data bytes, press CTRL_C to break
    Reply from 10.0.123.1: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 10.0.123.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 10.0.123.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 10.0.123.1: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 10.0.123.1: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 10.0.123.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/30/40 ms

12、随后查看R2上的OSPF路由条目,观察到去往 10.3.3.3/32网段的下一跳地址为10.0.123.3。

<R2>dis ip routing-table  protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 2        Routes : 2        

OSPF routing table status : <Active>
         Destinations : 2        Routes : 2

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       10.1.1.1/32  OSPF    10   48          D   10.0.123.1      Serial1/0/0
       10.3.3.3/32  OSPF    10   48          D   10.0.123.3      Serial1/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

13、在R2上查看帧中继映射关系。观察到,此时没有关于10.0.123.3的映射,如果R2要发送数据包到下一跳10.0.123.3,但无法知晓该从哪条PVC上进行发送和封装,可以使用PVC复用技术解决此问题。

<R2>dis fr map-info 
Map Statistics for interface Serial1/0/0 (DTE)
  DLCI = 201, IP 10.0.123.1, Serial1/0/0
    create time = 2022/02/14 17:23:29, status = ACTIVE
    encapsulation = ietf, vlink = 1

14、在R1的S1/0/0接口下添加一条帧中继静态映射,通过R1与R2的PVC去往10.0.123.3;同样需要在R3上也添加关于10.0.123.2的相关映射。

[R2]int s1/0/0
[R2-Serial1/0/0]fr map ip 10.0.123.3 201

[R3]int s1/0/0
[R3-Serial1/0/0]fr map ip 10.0.123.2 301

15、配置完成后,再在R2上查看帧中继映射关系。观察到已经添加了相应映射。

[R2]dis fr map-info 
Map Statistics for interface Serial1/0/0 (DTE)
  DLCI = 201, IP 10.0.123.1, Serial1/0/0
    create time = 2022/02/14 17:23:29, status = ACTIVE
    encapsulation = ietf, vlink = 1
  DLCI = 201, IP 10.0.123.3, Serial1/0/0
    create time = 2022/02/14 18:21:13, status = ACTIVE
    encapsulation = ietf, vlink = 2

16、再次测试R2和R3环回口的连通性。

[R2]ping -a 10.2.2.2 10.3.3.3
  PING 10.3.3.3: 56  data bytes, press CTRL_C to break
    Reply from 10.3.3.3: bytes=56 Sequence=1 ttl=254 time=40 ms
    Reply from 10.3.3.3: bytes=56 Sequence=2 ttl=254 time=40 ms
    Reply from 10.3.3.3: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 10.3.3.3: bytes=56 Sequence=4 ttl=254 time=30 ms
    Reply from 10.3.3.3: bytes=56 Sequence=5 ttl=254 time=30 ms

  --- 10.3.3.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/34/40 ms

5.3 思考

在第1步的基本配置中将R1的DR优先级设置成了100,为什么要这么做? 答:将R1的DR优先级设置成了100,保证R1在S1/0/0链路上称为DR。因为OSPF在链路上默认优先级为1,DR选举中,优先级越大越优,R1被称为DR。