搜索
您的当前位置:首页正文

帧中继上的OSPF

来源:抵帆知识网
帧中继是典型的NBMA(NonBroadcast Multiple Access)网络,其拓扑结构通常有两种:Full Mesh(全互联)和Hub-and-Spoke(中心-分支)

Hub-and-Spoke 结构具有节约费用、简化配置等优点,在实际网络工程中有着广泛的应用。

实验1: 帧中继环境下NBMA 模式

1.实验目的

通过本实验可以掌握:

(1)帧中继静态映射及broadcast 参数的含义 (2)NBMA 模式下的DR 选举 (3)手工配置OSPF 邻居

(4)NBMA 模式下OSPF 的配置和调试

2.拓扑结构

3.实验配置

R0 三层交换机模拟帧中继交换机配置

frame-relay switching //把该路由器当成帧中继交换机

interface Serial1/1 no ip address

encapsulation frame-relay serial restart-delay 0

clock rate 128000 //该接口为DCE,要配置时钟 no frame-relay inverse-arp frame-relay lmi-type cisco frame-relay intf-type dce

frame-relay route 102 interface Serial1/2 201 frame-relay route 103 interface Serial1/3 301

//“encapsulation frame-relay [ ietf ]”命令用来配置口封装成帧中继,如果不加ietf 参数,帧类型为cisco;如果加ietf 参数,则帧类型为ietf。

interface Serial1/2 no ip address

encapsulation frame-relay serial restart-delay 0 clock rate 128000

no frame-relay inverse-arp frame-relay lmi-type cisco frame-relay intf-type dce

frame-relay route 201 interface Serial1/1 102

interface Serial1/3 no ip address

encapsulation frame-relay serial restart-delay 0 clock rate 128000

frame-relay lmi-type cisco frame-relay intf-type dce

frame-relay route 301 interface Serial1/1 103

R1

interface Loopback0

ip address 1.1.1.1 255.255.255.0 ip ospf network point-to-point !

interface Serial1/1

ip address 123.1.1.1 255.255.255.0 encapsulation frame-relay serial restart-delay 0

frame-relay map ip 123.1.1.3 103 broadcast //帧中继静态映射 frame-relay map ip 123.1.1.2 102 broadcast

no frame-relay inverse-arp //关闭帧中继动态ARP解析 ip ospf network non-broadcast(默认) frame-relay lmi-type cisco !

router ospf 1

log-adjacency-changes

network 1.1.1.0 0.0.0.255 area 0 network 123.1.1.0 0.0.0.255 area 0 neighbor 123.1.1.3 neighbor 123.1.1.2 !

R2

interface Loopback0

ip address 2.2.2.2 255.255.255.0 ip ospf network point-to-point !

interface Serial1/2

ip address 123.1.1.2 255.255.255.0 encapsulation frame-relay

ip ospf priority 0 //配置spoke端OSPF接口优先级为0 ip ospf network non-broadcast(默认) serial restart-delay 0

frame-relay map ip 123.1.1.3 201 broadcast frame-relay map ip 123.1.1.1 201 broadcast frame-relay map ip 123.1.1.2 201 no frame-relay inverse-arp frame-relay lmi-type cisco ! !

router ospf 1

log-adjacency-changes

network 2.2.2.0 0.0.0.255 area 0 network 123.1.1.0 0.0.0.255 area 0

R3

interface Loopback0

ip address 3.3.3.3 255.255.255.0 ip ospf network point-to-point !

!

interface Serial1/3

ip address 123.1.1.3 255.255.255.0 encapsulation frame-relay ip ospf priority 0

ip ospf network non-broadcast(默认) serial restart-delay 0

frame-relay map ip 123.1.1.3 301

frame-relay map ip 123.1.1.1 301 broadcast frame-relay map ip 123.1.1.2 301 broadcast no frame-relay inverse-arp !

router ospf 1

log-adjacency-changes

network 3.3.3.0 0.0.0.255 area 0 network 123.1.1.0 0.0.0.255 area 0

4.实验调试

R3#sh ip ospf interface s1/3

Serial1/3 is up, line protocol is up

Internet Address 123.1.1.3/24, Area 0

Process ID 1, Router ID 3.3.3.3, Network Type NON_BROADCAST, Cost: 64 Transmit Delay is 1 sec, State DROTHER, Priority 0

Designated Router (ID) 1.1.1.1, Interface address 123.1.1.1 No backup designated router on this network

Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5 oob-resync timeout 120 Hello due in 00:00:20

Supports Link-local Signaling (LLS) Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0)

Last flood scan length is 1, maximum is 2

Last flood scan time is 4 msec, maximum is 4 msec Neighbor Count is 1, Adjacent neighbor count is 1

Adjacent with neighbor 1.1.1.1 (Designated Router) Suppress hello for 0 neighbor(s)

R1#show ip route ospf

2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/65] via 123.1.1.2, 00:00:25, Serial1/1 3.0.0.0/24 is subnetted, 1 subnets

O 3.3.3.0 [110/65] via 123.1.1.3, 00:00:25, Serial1/1

R1#ping 123.1.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 123.1.1.1, timeout is 2 seconds:

..... //没有配置frame-relay map ip 123.1.1.1 102,不能ping通自己。 Success rate is 0 percent (0/5) R1#ping 2.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

Success rate is 100 percent (5/5), round-trip min/avg/max = 60/91/128 ms R1#ping 3.3.3.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

Success rate is 100 percent (5/5), round-trip min/avg/max = 60/80/120 ms

R2#show ip route

1.0.0.0/24 is subnetted, 1 subnets

O 1.1.1.0 [110/65] via 123.1.1.1, 00:05:04, Serial1/2 2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Loopback0 3.0.0.0/24 is subnetted, 1 subnets

O 3.3.3.0 [110/65] via 123.1.1.3, 00:05:04, Serial1/2 123.0.0.0/24 is subnetted, 1 subnets

C 123.1.1.0 is directly connected, Serial1/2 R2#traceroute 3.3.3.3

Type escape sequence to abort. Tracing the route to 3.3.3.3

1 123.1.1.1 136 msec 80 msec 56 msec 2 123.1.1.3 144 msec * 144 msec

从以上输出表明,到达网络“3.3.3.0/24”的路由条目的下一跳地址为“134.1.1.3”, 而不是“134.1.1.1”,所以,在R2 的s1/2的接口上必须有到134.1.1.3 的映射 “frame-relay map ip 134.1.1.3 201 broadcast”。 【技术要点】 (1)在帧中继网络上,OSPF 接口缺省的网络类型为NON_BROADCAST。在这种模式下,OSPF 不会在帧中继接口上发送Hello 包,因此无法建立最基本的邻接关系。可以手工使用“neighbor”命令来指定邻居,这时Hello 包以单播形式传送;

(2)NBMA 属于多路访问网络,所以要进行DR 选举。由于Hello 包只能传1 跳,所以在Hub-and-Spoke 结构中,必须控制处于“Hub”端的路由器为DR,最保险的办法就是将“Spoke”端接口优先级配置为0,使之不参与DR 选举,“Hub”端的路由器自然就成为DR。否则,可能会导致路由学习不正常。

实验2:帧中继环境下BMA 模式

1.实验目的

(1)帧中继静态映射及broadcast 参数的含义 (2)BMA 模式下的DR 选举

(3)BMA 模式下OSPF 的配置和调试

2.拓扑结构

拓扑如实验1图。

3.实验配置

只需要将R1、R2、R3的模式修改一下即可,例如: R1(config-if)# ip ospf network broadcast

interface Loopback0

ip address 1.1.1.1 255.255.255.0 ip ospf network point-to-point !

interface Serial1/1

ip address 123.1.1.1 255.255.255.0 encapsulation frame-relay

ip ospf network broadcast //在接口更改ospf网络模式 serial restart-delay 0 clock rate 128000

frame-relay map ip 123.1.1.3 103 broadcast frame-relay map ip 123.1.1.2 102 broadcast no frame-relay inverse-arp frame-relay lmi-type cisco !

router ospf 1

log-adjacency-changes

network 1.1.1.0 0.0.0.255 area 0 network 123.1.1.0 0.0.0.255 area 0 其他设备如上更改 不再详细配置

4.实验调试

R1#sh ip ospf int s1/1

Serial1/1 is up, line protocol is up

Internet Address 123.1.1.1/24, Area 0

Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 64 //网络类型为BROADCAST

Transmit Delay is 1 sec, State DR, Priority 1

Designated Router (ID) 1.1.1.1, Interface address 123.1.1.1 No backup designated router on this network

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:00

Supports Link-local Signaling (LLS) Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0)

Last flood scan length is 1, maximum is 2

Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 2, Adjacent neighbor count is 2 Adjacent with neighbor 123.1.1.2 Adjacent with neighbor 123.1.1.3 Suppress hello for 0 neighbor(s)

R1#show ip route ospf

2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/65] via 123.1.1.2, 00:07:17, Serial1/1 3.0.0.0/24 is subnetted, 1 subnets

O 3.3.3.0 [110/65] via 123.1.1.3, 00:07:17, Serial1/1 【技术要点】

(1)在Hub-and-Spoke 结构中,BMA 也要控制DR 选举,确保处于“Hub”端的路由器 为DR,实施方法和实验1 一样;

(2)BMA 模式下,邻居关系自动通过Hello 包建立和维持。

实验3:帧中继环境下点到点(子接口)模式

点到点模式(point-to-point)

注意要使用frame-relay interface-dlci命令。 也不需要手动指定邻居

1.实验目的

(1)帧中继子接口下静态映射 (2)点到点模式的特征

(2)点到点模式下OSPF 的配置和调试

2.拓扑结构

实验1图。

3.实验配置

R1

interface Loopback0

ip address 1.1.1.1 255.255.255.0 ip ospf network point-to-point !

interface Serial1/1 no ip address

encapsulation frame-relay serial restart-delay 0 no frame-relay inverse-arp !

interface Serial1/1.1 point-to-point ip address 123.1.1.1 255.255.255.0 frame-relay interface-dlci 102 !

interface Serial1/1.2 point-to-point ip address 123.1.2.1 255.255.255.0 frame-relay interface-dlci 103 !

router ospf 1

router-id 1.1.1.1 log-adjacency-changes

network 1.1.1.0 0.0.0.255 area 0 network 123.1.1.0 0.0.0.255 area 0 network 123.1.2.0 0.0.0.255 area 0

R2

interface Loopback0

ip address 2.2.2.2 255.255.255.0 ip ospf network point-to-point !

interface Serial1/2 no ip address

encapsulation frame-relay serial restart-delay 0 no frame-relay inverse-arp !

interface Serial1/2.1 point-to-point ip address 123.1.1.2 255.255.255.0 frame-relay interface-dlci 201 !

router ospf 1

router-id 2.2.2.2 log-adjacency-changes

network 2.2.2.0 0.0.0.255 area 0 network 123.1.1.0 0.0.0.255 area 0

R3

interface Loopback0

ip address 3.3.3.3 255.255.255.0 ip ospf network point-to-point !

interface Serial1/3 no ip address

encapsulation frame-relay serial restart-delay 0 no frame-relay inverse-arp !

interface Serial1/3.1 point-to-point ip address 123.1.2.2 255.255.255.0 frame-relay interface-dlci 301 !

router ospf 1

router-id 3.3.3.3 log-adjacency-changes

network 0.0.0.0 255.255.255.255 area 0

4.实验调试

R1#sh ip ospf int s1/1.1

Serial1/1.1 is up, line protocol is up Internet Address 123.1.1.1/24, Area 0

Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64 //点到点模式下,Hello周期为10秒

Transmit Delay is 1 sec, State POINT_TO_POINT,

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:08

Supports Link-local Signaling (LLS) Index 2/2, flood queue length 0 Next 0x0(0)/0x0(0)

Last flood scan length is 1, maximum is 1

Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 2.2.2.2 Suppress hello for 0 neighbor(s) R1#sh ip ospf neighbor detail

Neighbor 3.3.3.3, interface address 123.1.2.2 In the area 0 via interface Serial1/1.2

Neighbor priority is 0, State is FULL, 6 state changes DR is 0.0.0.0 BDR is 0.0.0.0 Options is 0x52

LLS Options is 0x1 (LR) Dead timer due in 00:00:38 Neighbor is up for 00:49:51

Index 1/1, retransmission queue length 0, number of retransmission 1 First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)

Last retransmission scan length is 1, maximum is 1

Last retransmission scan time is 4 msec, maximum is 4 msec Neighbor 2.2.2.2, interface address 123.1.1.2

In the area 0 via interface Serial1/1.1

Neighbor priority is 0, State is FULL, 6 state changes DR is 0.0.0.0 BDR is 0.0.0.0 Options is 0x52

LLS Options is 0x1 (LR) Dead timer due in 00:00:38 Neighbor is up for 00:49:11

Index 2/2, retransmission queue length 0, number of retransmission 0 First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)

Last retransmission scan length is 0, maximum is 0

Last retransmission scan time is 0 msec, maximum is 0 msec 【技术要点】

1. 点到点模式的DR和BDR是“0.0.0.0”;

2. 点到点模式下,每个子接口需要配置不同的网络; 3. 点到点模式下,Hello周期为10秒。

进入子接口时选point to point,就不能使用frame-relay map命令了,只能用frame-relay interface-dlci做映射,选multipoint时候2者都可以用 点到点子接口就一条PVC所以只需用frame-relay interface-dlci来分配一个dlci号就行(而且是必须的)

多点子接口有多个PVC所以用frame-relay map来做映射,区别不同的PVC,因为路由器在启用子接口时inverse-arp不起作用的

4. 点到多点广播模式(point-to-multipoint)

1.实验目的

(1)帧中继子接口下静态映射 (2)点到多点模式的特征

(3)点到多点模式下OSPF 的配置和调试

2.拓扑结构

实验1拓扑图

3.实验配置

R1

interface Loopback0

ip address 1.1.1.1 255.255.255.0 ip ospf network point-to-point !

interface Serial1/1 no ip address

encapsulation frame-relay serial restart-delay 0

no frame-relay inverse-arp !

interface Serial1/1.1 multipoint ip address 123.1.1.1 255.255.255.0

ip ospf network point-to-multipoint

frame-relay map ip 123.1.1.3 103 broadcast frame-relay map ip 123.1.1.2 102 broadcast no frame-relay inverse-arp !

router ospf 1 router-id 1.1.1.1

log-adjacency-changes

network 1.1.1.0 0.0.0.255 area 0 network 123.1.1.0 0.0.0.255 area 0

R2

interface Loopback0

ip address 2.2.2.2 255.255.255.0 ip ospf network point-to-point !

interface Serial1/2

ip address 123.1.1.2 255.255.255.0 encapsulation frame-relay

ip ospf network point-to-multipoint serial restart-delay 0

frame-relay map ip 123.1.1.1 201 broadcast no frame-relay inverse-arp !

router ospf 1 router-id 2.2.2.2

log-adjacency-changes

network 2.2.2.0 0.0.0.255 area 0 network 123.1.1.0 0.0.0.255 area 0

R3

interface Loopback0

ip address 3.3.3.3 255.255.255.0 ip ospf network point-to-point !

interface Serial1/3

ip address 123.1.1.3 255.255.255.0 encapsulation frame-relay

ip ospf network point-to-multipoint serial restart-delay 0

frame-relay map ip 123.1.1.1 301 broadcast no frame-relay inverse-arp !

router ospf 1

router-id 3.3.3.3

log-adjacency-changes

network 3.3.3.0 0.0.0.255 area 0 network 123.1.1.0 0.0.0.255 area 0 R2#sh ip ospf interface s1/2 Serial1/2 is up, line protocol is up

Internet Address 123.1.1.2/24, Area 0

Process ID 1, Router ID 2.2.2.2, Network Type POINT_TO_MULTIPOINT, Cost: 64 // POINT_TO_MULTIPOINT 模式下,Hello 周期为30 秒

Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT,

Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5 oob-resync timeout 120 Hello due in 00:00:06

Supports Link-local Signaling (LLS) Index 3/3, flood queue length 0 Next 0x0(0)/0x0(0)

Last flood scan length is 1, maximum is 1

Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 1.1.1.1 Suppress hello for 0 neighbor(s) R1#sh ip route ospf

2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/65] via 123.1.1.2, 00:18:40, Serial1/1.1 3.0.0.0/24 is subnetted, 1 subnets

O 3.3.3.0 [110/65] via 123.1.1.3, 00:18:40, Serial1/1.1 123.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

O 123.1.1.3/32 [110/64] via 123.1.1.3, 00:18:40, Serial1/1.1 O 123.1.1.2/32 [110/64] via 123.1.1.2, 00:18:40, Serial1/1.1 R3#sh ip route ospf

1.0.0.0/24 is subnetted, 1 subnets

O 1.1.1.0 [110/65] via 123.1.1.1, 00:20:29, Serial1/3 2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/129] via 123.1.1.1, 00:20:29, Serial1/3 123.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

O 123.1.1.2/32 [110/128] via 123.1.1.1, 00:20:29, Serial1/3 O 123.1.1.1/32 [110/64] via 123.1.1.1, 00:20:29, Serial1/3 以上输出表明在点到多点模式中,在路由表中会产生该网段其他各个接口的主机路由,因此在做帧中继映射的时候,只做到中心点的就可以了 【技术要点】

(1)点到多点广播模式可以被看成多个点到点接口的集合,然而和点到点不同的是帧中继接口是在同一子网上;

(2)在点到多点模式中,不需要选举DR/BDR;

(3)Hello 包每30 秒发送一次,无需手工配置邻居。

R2#sh ip ospf neighbor detail

Neighbor 1.1.1.1, interface address 123.1.1.1 In the area 0 via interface Serial1/2

Neighbor priority is 0, State is FULL, 6 state changes DR is 0.0.0.0 BDR is 0.0.0.0 Options is 0x52

LLS Options is 0x1 (LR)

Dead timer due in 00:01:30 Neighbor is up for 00:08:29

Index 1/1, retransmission queue length 0, number of retransmission 0 First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)

Last retransmission scan length is 0, maximum is 0

Last retransmission scan time is 0 msec, maximum is 0 msec

5. 点到多点非广播模式(point-to-multipoint broadcast)

需要修改三个地方: 模式加non-broadcast

帧中继映射去掉broadcast 设置邻居 例如:

R1(config-if)#ip ospf network point-to-multipoint non-broadcast R1(config-if)#frame-relay map ip 123.1.1.2 102 R1(config-if)#frame-relay map ip 123.1.1.3 103 R1(config-router)#neighbor 123.1.1.2 R1(config-router)#neighbor 123.1.1.3

R2、R3不需要配置neighbor,只要一方配置了就可以

R2(config-if)#ip ospf network point-to-multipoint non-broadcast R2(config-if)#frame-relay map ip 123.1.1.1 201 这种模式下使用单播来发送OSPF分组

6. 非广播模式(non-broadcast)

只要将广播模式中R1、R2、R3的模式修改一下即可 R1(config-if)#ip ospf network non-broadcast 这种模式使用单播发送hello

因篇幅问题不能全部显示,请点此查看更多更全内容

Top