1:用自己的语言描述OSPF接口的类型及LSA新旧的比较
2:LAB:NBMA环境,使用OSPF协议使SPOKE端可以正常通信,不能修改接口的OSPF网络类型
作业一:用自己的语言描述OSPF接口的类型及LSA新旧的比较。
OSPF接口的类型有:broadcast,NBMA,point-to-point,point-to-muitipoint四种类型
可以通过:ip ospf network xx 命令修改类型参数。
Broadcast:hello-time为10s,dead时间为40s wait时间为40s, 组播发送
NBMA:hello-time为30s,dead时间为120s wait时间为120s, 单播发送
point-to-point:hello-time为10s,dead时间为40s wait时间为40s,组播发送
point-to-muitipoint:hello-time为30s,dead时间为120s wait时间为120s,组播发送。
LSA:默认为1800s更新一次,序列号增加1(默认序列号从0x80000001开始到0x7FFFFFFFF),如果在3600s内没有收到更新信息,就老化LSA。
1:先比较LSA的序列号,值越大则越优先。
2:序列号一致时,则会比较checksum值,如果这个值越大则优先。
3:当序列号和checksum值都相同,则比较AGE时间是不是会等于3600s,如果相等,则表示为最新的。
4:如果AGE时间不等于3600s,会计算两者之间的差,如果差值大于15分钟,则越小月优先,如果小于15分钟,则视为同一条路由。
LAB:NBMA环境,使用OSPF协议使SPOKE端可以正常通信,不能修改接口的OSPF网络类型
使用拓扑图:
以下是R1,R2,R3设备的配置信息:
R1的配置信息:
R1(config-if)#do show run int s1/0 //验证接口s1/0的配置信息
Building configuration...
Current configuration : 202 bytes
!
interface Serial1/0
ip address 123.1.1.1 255.255.255.0 //接口s1/0的IP地址信息
encapsulation frame-relay //接口s1/0封装FR
serial restart-delay 0
frame-relay map ip 123.1.1.3 103 broadcast //FR map 配置
frame-relay map ip 123.1.1.2 102 broadcast //FR map 配置
end
R1(config-if)#do show fram map 验证FR map
Serial1/0 (up): ip 123.1.1.2 dlci 102(0x66,0x1860), static,
broadcast,
CISCO, status defined, active
Serial1/0 (up): ip 123.1.1.3 dlci 103(0x67,0x1870), static,
broadcast,
CISCO, status defined, active
R1(config-if)#do ping 123.1.1.2 //测试123.1.1.2的地址
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 123.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/8/12 ms
===============================================================================
R2的配置信息:
R2(config-if)#do show run int s1/0 //验证接口s1/0的配置信息
Building configuration...
Current configuration : 158 bytes
!
interface Serial1/0
ip address 123.1.1.2 255.255.255.0 //接口s1/0的IP地址信息
encapsulation frame-relay //接口s1/0封装FR
serial restart-delay 0
frame-relay map ip 123.1.1.1 201 broadcast //FR map 配置
end
R2(config-if)#do show fram map
Serial1/0 (up): ip 123.1.1.3 dlci 201(0xC9,0x3090), static,
broadcast,
CISCO, status defined, active //在没有这一条的时候R2测试不通R3
Serial1/0 (up): ip 123.1.1.1 dlci 201(0xC9,0x3090), static,
broadcast,
CISCO, status defined, active
R2(config-if)#do ping 123.1.1.1 //测试123.1.1.1的地址
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 123.1.1.1, timeout is 2 seconds:
..!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 16/29/48 ms
===============================================================================
R3的配置信息:
R3(config-if)#do show run int s1/0 //验证接口s1/0的配置信息
Building configuration...
Current configuration : 158 bytes
!
interface Serial1/0
ip address 123.1.1.3 255.255.255.0 //接口s1/0的IP地址信息
encapsulation frame-relay //接口s1/0封装FR
serial restart-delay 0
frame-relay map ip 123.1.1.1 301 broadcast //FR map 配置
end
R3(config-if)#do show fram map
Serial1/0 (up): ip 123.1.1.2 dlci 301(0x12D,0x48D0), static,
broadcast,
CISCO, status defined, active //在没有这一条的时候R3测试不通R2
Serial1/0 (up): ip 123.1.1.1 dlci 301(0x12D,0x48D0), static,
broadcast,
CISCO, status defined, active
R3(config-if)#do 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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/24/40 ms
R3(config-if)#do ping 123.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 123.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/34/44 ms
R3可以ping通R1但是无法ping通R2因为没有到达R2和dlci号的对应关系不能进行通信。
===============================================================================
为R1,R2,R3运行ospf并手工指定邻居:
R1的OSPF配置信息:
R1(config-router)#do show run | se ospf
ip ospf 110 area 0 //开启运行ospf动态路由协议区域0
router ospf 110 //运行ospf
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0 //宣告网段
neighbor 123.1.1.2 //手工指定邻居
neighbor 123.1.1.3 //手工指定邻居
R1(config-router)#do show ip ospf int b
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Lo0 110 0 1.1.1.1/24 1 LOOP 0/0
Se1/0 110 0 123.1.1.1/24 64 DR 2/2
R1(config-router)#do 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
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 123.1.1.2, 00:17:04, Serial1/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 123.1.1.3, 00:19:18, Serial1/0
123.0.0.0/24 is subnetted, 1 subnets
C 123.1.1.0 is directly connected, Serial1/0
R2的OSPF配置信息:
R2(config-router)#do show run | se ospf
ip ospf priority 0 //ospf 优先级改为0
ip ospf 110 area 0 //开启运行ospf动态路由协议区域0
router ospf 110 //运行ospf
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0 //宣告网段
R2(config-router)#do show ip ospf int b
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Lo0 110 0 2.2.2.2/24 1 LOOP 0/0
Se1/0 110 0 123.1.1.2/24 64 DROTH 1/1
R2(config-if)#do 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/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 123.1.1.1, 00:16:35, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 123.1.1.3, 00:16:35, Serial1/0
123.0.0.0/24 is subnetted, 1 subnets
C 123.1.1.0 is directly connected, Serial1/0
R3的OSPF配置信息:
R3#show run | se ospf
ip ospf priority 0 //ospf 优先级改为0
ip ospf 110 area 0 //开启运行ospf动态路由协议区域0
router ospf 110 //运行ospf
log-adjacency-changes
network 3.3.3.0 0.0.0.255 area 0 //宣告网段
R3#show ip ospf int b
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Lo0 110 0 3.3.3.3/24 1 LOOP 0/0
Se1/0 110 0 123.1.1.3/24 64 DROTH 1/1
R3(config-if)#do 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/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 123.1.1.1, 00:28:38, Serial1/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 123.1.1.2, 00:15:58, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
123.0.0.0/24 is subnetted, 1 subnets
C 123.1.1.0 is directly connected, Serial1/0
测试结果:R3测试R1和R2
R3(config-if)#do 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 = 8/18/24 ms
R3(config-if)#do 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 = 20/28/40 ms