OSPF与Loopback地址

简介:

 

 

实验要求:按照上图配置接口地址以及OSPF,使两台路由器互相学习到对方的Loopback地址, 使出现在路由表中对方的Loopback地址的掩码为 /8

 
具体配置:

 
R1:
interface Loopback0
ip address 1.1.1.1 255.0.0.0
ip ospf network point-to-point
!
interface Ethernet0/0
ip address 10.0.0.1 255.0.0.0
!
router ospf 1
network 0.0.0.0 255.255.255.255 area 0

 
R2:
interface Loopback0
ip address 2.2.2.2 255.0.0.0
ip ospf network point-to-point
!
interface Ethernet0
ip address 10.0.0.2 255.0.0.0
!
router ospf 1
network 0.0.0.0 255.255.255.255 area 0

 
未作point-to-point 配置之前
--------------------------------------------------------------------------------->>
我们会发现学习到对方loopback地址永远是/32位,原因是OSPF默认设置了Loopback地址的网络类型,并且把loopback地址当成一个stub主机。
我尝试过使用summery-address、和通告是使用1.0.0.0 0.255.255.255  ,但是结果一样学习到对方loopback地址永远为/32
R1#show ip ospf interface loopback0
Loopback0 is up, line protocol is up
Internet Address 1.1.1.1/8, Area 0
Process ID 1, Router ID 1.1.1.1,  Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
R1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
C 1.0.0.0/8 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 10.0.0.2, 00:08:59, Ethernet0
C 10.0.0.0/8 is directly connected, Ethernet0
R2#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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/11] via 10.0.0.1, 00:07:28, Ethernet0
C 2.0.0.0/8 is directly connected, Loopback0
C 10.0.0.0/8 is directly connected, Ethernet0

做了 point-to-point 配置之后
------------------------------------------------------------------------------------------>>
R1#show ip ospf interface loopback0
Loopback0 is up, line protocol is up
Internet Address 1.1.1.1/8, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
No Hellos (Passive interface)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
R1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
C 1.0.0.0/8 is directly connected, Loopback0
O 2.0.0.0/8 [110/11] via 10.0.0.2, 00:00:53, Ethernet0
C 10.0.0.0/8 is directly connected, Ethernet0
R2#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
O 1.0.0.0/8 [110/11] via 10.0.0.1, 00:01:47, Ethernet0
C 2.0.0.0/8 is directly connected, Loopback0
C 10.0.0.0/8 is directly connected, Ethernet0


本文转自zcm8483 51CTO博客,原文链接:http://blog.51cto.com/haolun/993188
相关文章
|
5月前
|
网络协议 算法 数据库
OSPF总结
该文章为OSPFv2版本的一些总结,暂时没有OSPFv3
OSPF总结
|
5月前
|
负载均衡 网络协议 算法
IP路由协议(RIP、IGRP、OSPF、IS-IS、BGP)
1、路由分类 路由产生方式: 直接路由:路由器会自动生成本路由器激活端口所在网段的路由条目 静态路由:网络管理员手工配置,静态路由信息在缺省的情况下私有的,不会传递给其他的路由器
|
11月前
|
网络协议 安全 数据库
浅谈OSPF
浅谈OSPF
70 0
|
网络协议
配置OSPF
配置OSPF
74 0
配置OSPF
|
网络协议 网络架构 iOS开发
IPv6 RIP(RIPng)
文章目录 IPv6 RIP(RIPng) 配置RIPng 1.初始化配置: 2.启动RIPng进程 3. 配置RIPng接口 4. 查看RIPng路由 5. 测试连通性 6. 重分布IPv6网段 7. 过滤IPv6路由
255 0
IPv6 RIP(RIPng)
|
人工智能 网络协议 算法
OSPF详解(一)
一、OSPF的五种包Hellow:发现邻居建立邻接关系DBD:检查路由器的数据库之间是否同步LSR:向另外一台设备请求特定的链路状态LSU:发送链路状态信息LSACK:确认多段的发送信息二、OSPF的三张表1、 邻居列表:列出每台路由器全部已经建立邻接关系的邻居路由器2、 链路状态数据库:列出网络中其他路由器的信息,由此显示了全网的网络拓扑3、 路由表:列出通过SPF算法计算出到达每个相连网络的最佳路径三、OSPF的特点1、 区域概念,有效减少路由条目对CPU和内存占用,将拓扑变动局限在本区域内,详细的LSA泛洪控制2、 邻接关系。OSPF协议定义了一些路由器类型和网络全相同时,就以自身为根,
|
存储 负载均衡 网络协议
OSPF详解(二)
十六、OSPF区域1、 区域0:汇总每个区域的网络拓扑到其他区域。所有的域间通信量必须通过骨干区域,非骨干区域不能直接交换数据包。2、 路由器类型:IR、BR、ABR、ASBR3、 IR:所有接口都属于同一区域的路由器。4、 BR:至少有一个接口是与骨干area0相连的路由器。Area0不一定是骨干区域,但骨干区域–定是area0,要成为骨干必须有一个邻接关系在里面5、 ABR:连接其他区域到骨干区域,至少一个接口属于骨干区域。6、 ASBR: OSPF域外部的通信量进入0SPF域的网络路由器。7、 0SPF的虚链路:一条通过非骨干区域连接到骨干区域的链路。通过非骨干区域修复分段efreshT
|
存储 网络协议 数据库
|
网络协议 数据库 数据安全/隐私保护