【实验目的】
掌握OSPF在帧中继网络中的配置方法
理解Hub- Spoke组网架构
掌握在帧中继网络中排除OSPF故障的方法
【实验环境】
IP地址规划表
设备 |
接口 |
IP地址 |
子网掩码 |
R1 |
S0/0/0 |
10.45.123.1 |
255.255.255.0 |
E0/0/0 |
10.45.1.1 |
255.255.255.0 |
|
R2 |
S0/0/1 |
10.45.123.2 |
255.255.255.0 |
E0/0/0 |
10.45.2.1 |
255.255.255.0 |
|
R3 |
S0/0/2 |
10.45.123.3 |
255.255.255.0 |
E0/0/0 |
10.45.3.1 |
255.255.255.0 |
|
PC1 |
E0/0/1 |
10.45.1.10 |
255.255.255.0 |
PC2 |
E0/0/1 |
10.45.2.10 |
255.255.255.0 |
PC3 |
E0/0/1 |
10.45.3.10 |
255.255.255.0 |
【实验过程】
27.1基本配置
在R1、R2、R3上配置帧帧中继接口,关闭帧中继逆向地址解析功能,其中将R1设置为DR,DR优先级为100:
AR1
<Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sys AR1 [AR1]link-protocol fr ietf [AR1]int s0/0/0 [AR1-Serial0/0/0]link-protocol fr ietf Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y [AR1-Serial0/0/0]ip add 10.45.123.1 24 [AR1-Serial0/0/0]undo fr inarp [AR1-Serial0/0/0]fr map ip 10.45.123.2 102 [AR1-Serial0/0/0]fr map ip 10.45.123.3 103 [AR1-Serial0/0/0]ospf dr-priority 100 [AR1-Serial0/0/0]q [AR1]int e0/0/0 [AR1-Ethernet0/0/0]ip add 10.45.1.1 24 [AR1-Ethernet0/0/0]q
AR2
<Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sys AR2 [AR2]int s0/0/1 [AR2-Serial0/0/1]link-protocol fr ietf Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y [AR2-Serial0/0/1]ip add 10.45.123.2 24 [AR2-Serial0/0/1]undo fr inarp [AR2-Serial0/0/1]fr map ip 10.45.123.1 201 [AR2-Serial0/0/1]q [AR2]int e0/0/0 [AR2-Ethernet0/0/0]ip add 10.45.2.1 24 [AR2-Ethernet0/0/0]q
AR3
<Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sys AR3 [AR3]int s0/0/2 [AR3-Serial0/0/2]link-protocol fr ietf Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y [AR3-Serial0/0/2]ip add 10.45.123.3 24 [AR3-Serial0/0/2]undo fr inarp [AR3-Serial0/0/2]fr map ip 10.45.123.1 301 [AR3-Serial0/0/2]q [AR3]int e0/0/0 [AR3-Ethernet0/0/0]ip add 10.45.3.1 24 [AR3-Ethernet0/0/0]q
27.2查看帧中继的虚电路和映射表
[AR1]dis fr pvc-info PVC statistics for interface Serial0/0/0 (DTE, physical UP) DLCI = 102, USAGE = LOCAL (00000100), Serial0/0/0 create time = 2020/11/21 18:45:33, status = ACTIVE InARP = Disable in BECN = 0, in FECN = 0 in packets = 0, in bytes = 0 out packets = 1, out bytes = 30 DLCI = 103, USAGE = LOCAL (00000100), Serial0/0/0 create time = 2020/11/21 18:45:33, status = ACTIVE InARP = Disable in BECN = 0, in FECN = 0 in packets = 0, in bytes = 0 out packets = 1, out bytes = 30 [AR1]dis fr map-info Map Statistics for interface Serial0/0/0 (DTE) DLCI = 102, IP 10.45.123.2, Serial0/0/0 create time = 2020/11/21 18:45:59, status = ACTIVE encapsulation = ietf, vlink = 3 DLCI = 103, IP 10.45.123.3, Serial0/0/0 create time = 2020/11/21 18:46:00, status = ACTIVE encapsulation = ietf, vlink = 4
27.3测试连通性
R1和R2的连通性
R1和R2的连通性
27.4在帧中继上搭建OSPF网络
AR1
[AR1]ospf router-id 10.45.1.10 [AR1-ospf-1]area 0 [AR1-ospf-1-area-0.0.0.0]net 10.45.123.1 0.0.0.255 [AR1-ospf-1-area-0.0.0.0]net 10.45.1.10 0.0.0.255 [AR1-ospf-1-area-0.0.0.0]q [AR1-ospf-1]q
AR2
[AR2]ospf router-id 10.45.2.10 [AR2-ospf-1]area 0 [AR2-ospf-1-area-0.0.0.0]net 10.45.123.2 0.0.0.255 [AR2-ospf-1-area-0.0.0.0]net 10.45.2.10 0.0.0.255 [AR2-ospf-1-area-0.0.0.0]q [AR2-ospf-1]q
AR3
[AR3]ospf router-id 10.45.3.10 [AR3-ospf-1]area 0 [AR3-ospf-1-area-0.0.0.0]net 10.45.123.2 0.0.0.255 [AR3-ospf-1-area-0.0.0.0]net 10.45.3.10 0.0.0.255 [AR3-ospf-1-area-0.0.0.0]q [AR3-ospf-1]q
27.5查看R1的邻居
[AR1]dis ospf peer OSPF Process 1 with Router ID 10.45.1.1
发现无法正常建立邻居,这是明显的网络故障。于是我们来排查故障,排查故障时应遵循底层逐步向上层的顺序,即先检查物理层,然后二层链路层,之后高层。
物理层的检查这里省略,直接测试连通性:
[AR1]ping 10.45.123.2 PING 10.45.123.2: 56 data bytes, press CTRL_C to break Reply from 10.45.123.2: bytes=56 Sequence=1 ttl=255 time=70 ms Reply from 10.45.123.2: bytes=56 Sequence=2 ttl=255 time=10 ms Reply from 10.45.123.2: bytes=56 Sequence=3 ttl=255 time=10 ms Reply from 10.45.123.2: bytes=56 Sequence=4 ttl=255 time=110 ms Reply from 10.45.123.2: bytes=56 Sequence=5 ttl=255 time=40 ms --- 10.45.123.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 10/48/110 ms
可以观察到,直连链路没有问题,我们来检查三层路由协议,即相应接口是否被通告到OSPF进程中。
[AR1]display ospf interface OSPF Process 1 with Router ID 10.45.1.10 Interfaces Area: 0.0.0.0 (MPLS TE not enabled) IP Address Type State Cost Pri DR BDR 10.45.123.1 NBMA DR 1562 100 10.45.123.1 0.0.0.0 10.45.1.1 P2P P-2-P 0 1 10.45.1.1 0.0.0.0
发现R1始终没有向外发送OSPF报文,这是因为OSPF在帧中继上默认的网络类型为NBMA,即非广播多路访问。这种类型是不支持广播和组播的,而OSPF默认时组播发送,故OSPF无法在帧中继中发送报文,无法建立邻居关系。
可以采取手工配置邻居,单播发送报文。
27.6手工配置邻居
AR1
[AR1]ospf [AR1-ospf-1]peer 10.45.123.2 [AR1-ospf-1]peer 10.45.123.3 [AR1-ospf-1]q
AR2
[AR2]ospf [AR2-ospf-1]peer 10.45.123.1 [AR2-ospf-1]peer 10.45.123.3 [AR2-ospf-1]q
AR3
[AR3]ospf [AR3-ospf-1]peer 10.45.123.1 [AR3-ospf-1]peer 10.45.123.2 [AR3-ospf-1]q
查看R1的邻居关系
可以看到,邻居关系已经建立成功。
27.7配置PVC复用技术
[AR2-Serial0/0/1]fr map ip 10.45.123.3 201 [AR3-Serial0/0/2]fr map ip 10.45.123.2 301
27.8测试R2和R3的的连通性
PC>ping 10.45.123.3 Ping 10.45.123.3: 32 data bytes, Press Ctrl_C to break From 10.45.123.3: bytes=32 seq=1 ttl=255 time=109 ms From 10.45.123.3: bytes=32 seq=2 ttl=255 time=47 ms From 10.45.123.3: bytes=32 seq=3 ttl=255 time=47 ms From 10.45.123.3: bytes=32 seq=4 ttl=255 time=31 ms From 10.45.123.3: bytes=32 seq=5 ttl=255 time=63 ms --- 10.45.123.3 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 31/59/109 ms
知识点总结
帧中继(frame-ralay)是一种广域网技术,属于分组交换门里的一种;frame-relay是一种二层技术,与具体的物理链路无关。再说说ospf:ospf是一种动态路由协议,用以生成路由表,是众多的路由协议中较为优秀的一种,一般用再大中型企业。路由表是路由器转发数据所依赖的一张表。因此可以说没有路由协议就没有路由表,路由器就不能完成转发数据的重任。