OSPF NBMA全网互联与部分互联的比较
一、NBMA部分网络互联:
帧中继交换机配置:
frame-relay switching
int s0/1
en frame
frame-relay intf-type dce
frame-relay route 102 interface s0/2 201
frame-relay route 103 interface s0/3 301
no shut
exit
int s0/2
en frame
frame-relay intf-type dce
frame-relay route 201 interface s0/1 102
no shut
exit
int s0/3
en frame
frame-relay intf-type dce
Rframe-relay route 301 interface s0/1 103
no shut
exit
HUB端配置:
int loopback 0
ip add 1.1.1.1 255.255.255.0
ip ospf network point-to-point
end
int s0/1
ip ospf priority 2
ip add 221.16.1.1 255.255.255.0
no shut
encapsulation frame-relay
no frame-relay inverse-arp
frame-relay map ip 221.16.1.2 102 broadcast
frame-relay map ip 221.16.1.3 103 broadcast
exit
router ospf 10
router-id 1.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 221.16.1.0 0.0.0.255 area 0
neighbor 221.16.1.2
neighbor 221.16.1.3
end
SPOKE-1(R2)端配置:
int loopback 0
ip add 2.2.2.2 255.255.255.0
ip ospf network point-to-point
exit
config t
int s0/2
ip ospf priority 1
ip add 221.16.1.2 255.255.255.0
no shut
encapsulation frame-relay
no frame-relay inverse-arp
frame-relay map ip 221.16.1.1 201 broadcast
exit
router ospf 10
router-id 2.2.2.2
network 2.2.2.0 0.0.0.255 area 0
network 221.16.1.0 0.0.0.255 area 0
neighbor 221.16.1.1
end
SPOKE-2(R3)端配置:
int loopback 0
ip add 3.3.3.3 255.255.255.0
ip ospf network point-to-point
end
config t
int s0/3
ip ospf priority 0
ip add 221.16.1.3 255.255.255.0
no shut
encapsulation frame-relay
no frame-relay inverse-arp
frame-relay map ip 221.16.1.1 301 broadcast
exit
router ospf 10
router-id 3.3.3.3
network 221.16.1.0 0.0.0.255 area 0
network 3.3.3.0 0.0.0.255 area 0
neighbor 221.16.1.1
end
1、配置后查询:R1与R2、R3建立邻接关系,而R3、R2都分别与R1建立邻接关系。
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DROTHER 00:01:56 221.16.1.2 Serial0/1
3.3.3.3 1 FULL/BDR 00:01:55 221.16.1.3 Serial0/1
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DR 00:01:45 221.16.1.1 Serial0/2
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DR 00:01:53 221.16.1.1 Serial0/3
2、显示接口下的各项参数:
R1#show ip ospf int s0/1
Serial0/1 is up, line protocol is up
Internet Address 221.16.1.1/24, Area 0
Process ID 10, Router ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 64
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 221.16.1.1
Backup Designated router (ID) 3.3.3.3, Interface address 221.16.1.3
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
oob-resync timeout 120
Hello due in 00:00:11
Supports Link-local Signaling (LLS)
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 2
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 2.2.2.2
Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
3、测试路由表:
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
C 221.16.1.0/24 is directly connected, Serial0/1
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0 [110/65] via 221.16.1.2, 00:00:22, Serial0/1
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0 [110/65] via 221.16.1.3, 00:00:22, Serial0/1
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/65] via 221.16.1.1, 00:00:36, Serial0/2
C 221.16.1.0/24 is directly connected, Serial0/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 221.16.1.3, 00:00:36, Serial0/2
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/65] via 221.16.1.1, 00:01:15, Serial0/3
C 221.16.1.0/24 is directly connected, Serial0/3
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0 [110/65] via 221.16.1.2, 00:01:15, Serial0/3
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
4、PING测试:
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 = 196/361/492 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 = 256/336/452 ms
R2#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 256/304/360 ms
R2#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 0 percent (0/5)
R4#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 156/271/504 ms
R4#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 0 percent (0/5)
5、测试将R2、R3配置互相单播通告地址:
R2
router ospf 10
neighbor 221.16.1.3
R3
router ospf 10
neighbor 221.16.1.2
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
N/A 0 ATTEMPT/DROTHER 00:01:50 221.16.1.3 Serial0/2
1.1.1.1 1 FULL/DR 00:01:37 221.16.1.1 Serial0/2
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
N/A 0 ATTEMPT/DROTHER 00:00:14 221.16.1.2 Serial0/3
1.1.1.1 2 FULL/DR 00:01:41 221.16.1.1 Serial0/3
R3:
*Mar 1 00:15:08.191: %OSPF-5-ADJCHG: Process 10, Nbr 0.0.0.0 on Serial0/3 from ATTEMPT to DOWN, Neighbor Down: Dead timer expired
R2:*Mar 1 00:16:35.123: %OSPF-5-ADJCHG: Process 10, Nbr 0.0.0.0 on Serial0/2 from ATTEMPT to DOWN, Neighbor Down: Dead timer expired
原因在于:帧中继交换机上没有R2-R3,R3-R2的帧中继路由表,所以无法实现NBMA全互联。帧中继网络非全互联,R3与R1建立邻接时,R3不知道有R2存在,R2与R1建立邻接时也不知道R3存在,网络运行于两个不同的OSPF自治系统。
二、 OSPF NBMA网络全互联:
帧中继交换机配置:
#frame-relay switching
int s0/1
en frame
frame-relay intf-type dce
frame-relay route 102 interface s0/2 201
frame-relay route 103 interface s0/3 301
no shut
exit
int s0/2
en frame
frame-relay intf-type dce
frame-relay route 201 interface s0/1 102
frame-relay route 203 intetface s0/3 302
no shut
exit
int s0/3
en frame
frame-relay intf-type dce
frame-relay route 301 interface s0/1 103
frame-relay route 302 interface s0/2 203
no shut
exit
HUB端配置:
int loopback 0
ip add 1.1.1.1 255.255.255.0
ip ospf network point-to-point
end
int s0/1
ip ospf priority 10
ip add 221.16.1.1 255.255.255.0
no shut
encapsulation frame-relay
no frame-relay inverse-arp
frame-relay map ip 221.16.1.2 102 broadcast
frame-relay map ip 221.16.1.3 103 broadcast
exit
router ospf 10
router-id 1.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 221.16.1.0 0.0.0.255 area 0
neighbor 221.16.1.2
neighbor 221.16.1.3
end
SPOKE-1(R2)端配置:
int loopback 0
ip add 2.2.2.2 255.255.255.0
ip ospf network point-to-point
end
config t
int s0/2
ip ospf priority 5
ip add 221.16.1.2 255.255.255.0
no shut
encapsulation frame-relay
no frame-relay inverse-arp
frame-relay map ip 221.16.1.1 201 broadcast
frame-relay map ip 221.16.1.3 203 broadcast
exit
router ospf 10
router-id 2.2.2.2
network 2.2.2.0 0.0.0.255 area 0
network 221.16.1.0 0.0.0.255 area 0
neighbor 221.16.1.1
neighbor 221.16.1.3
end
SPOKE-2(R3)端配置:
int loopback 0
ip add 3.3.3.3 255.255.255.0
ip ospf network point-to-point
end
config t
int s0/3
ip ospf priority 0
ip add 221.16.1.3 255.255.255.0
no shut
encapsulation frame-relay
no frame-relay inverse-arp
frame-relay map ip 221.16.1.1 301 broadcast
frame-relay map ip 221.16.1.2 302 broadcast
exit
router ospf 10
router-id 3.3.3.3
network 221.16.1.0 0.0.0.255 area 0
network 3.3.3.0 0.0.0.255 area 0
neighbor 221.16.1.1
neighbor 221.16.1.2
end
测试网络:
1、查看R1、R3、R4的邻居关系表:
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 5 FULL/BDR 00:01:34 221.16.1.2 Serial0/1
3.3.3.3 0 FULL/DROTHER 00:01:31 221.16.1.3 Serial0/1
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 0 FULL/DROTHER 00:01:56 221.16.1.3 Serial0/2
1.1.1.1 10 FULL/DR 00:01:55 221.16.1.1 Serial0/2
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 5 FULL/BDR 00:01:45 221.16.1.2 Serial0/3
1.1.1.1 10 FULL/DR 00:01:44 221.16.1.1 Serial0/3
2、查看路由表:
R1#show ip route ospf
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0 [110/65] via 221.16.1.2, 00:12:04, Serial0/1
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0 [110/65] via 221.16.1.3, 00:12:04, Serial0/1
R2#show ip route ospf
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/65] via 221.16.1.1, 00:12:17, Serial0/2
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0 [110/65] via 221.16.1.3, 00:12:17, Serial0/2
R3#show ip route ospf
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/65] via 221.16.1.1, 00:12:56, Serial0/3
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0 [110/65] via 221.16.1.2, 00:12:56, Serial0/3
3、PING测试:
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 = 172/298/376 ms
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 = 244/313/420 ms
R2#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 168/337/428 ms
R2#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 = 196/309/416 ms
R4#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 = 140/286/384 ms
R4#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 288/322/404 ms