OSPF 路由引入以及缺省路由

default-route-advertise: 当外部路由存在缺省路由时,即引入并在OSPF区域内泛宏;default-route-advertise always:无论是否存在缺省路由,都会生成一条外部路由在OSPF区域内泛宏,此种方法为引入缺省路由。

import route 是ospf里面引入其他协议的路由(如static,bgp,rip),不能引入外部的缺省路由。


R2、R3、R4使用OSPF协议,配置如下:

R1

#
interface Ethernet0/0/0
 description to-R2
 ip address 10.10.1.1 255.255.255.252
#

#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255
#
ip route-static 0.0.0.0 0.0.0.0 10.10.1.2
#

R2

#
interface Ethernet0/0/0
 description to-R1
 ip address 10.10.1.2 255.255.255.252
#
interface Ethernet0/0/1
 description to-R3
 ip address 10.10.2.1 255.255.255.252
 ospf authentication-mode md5 1 cipher CM)gG6|w^8pe}@HMNPn@t>a#
 ospf network-type p2p
#

#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255
 ospf enable 1 area 0.0.0.0
#
ospf 1 router-id 2.2.2.2
 import-route static
 area 0.0.0.0
  network 10.10.1.0 0.0.0.255
  network 10.10.2.0 0.0.0.255
#
ip route-static 1.1.1.1 255.255.255.255 10.10.1.1
#

R3

#
interface Ethernet0/0/0
 description to-R2
 ip address 10.10.2.2 255.255.255.252
 ospf authentication-mode md5 1 cipher mokG=CKHnX+/Y@:Y>Lw(Q~##
 ospf network-type p2p
#
interface Ethernet0/0/1
 description to-R4
 ip address 10.10.3.1 255.255.255.252
#

#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255
 ospf enable 2 area 0.0.0.0
#
ospf 2 router-id 3.3.3.3
 area 0.0.0.0
  network 10.10.2.0 0.0.0.3
  network 10.10.3.0 0.0.0.3
#

R4

#
interface Ethernet0/0/0
 description to-R3
 ip address 10.10.3.2 255.255.255.252
#
interface Ethernet0/0/1
 description to-R5
 ip address 10.10.4.1 255.255.255.252
#

#
interface LoopBack0
 ip address 4.4.4.4 255.255.255.255
 ospf enable 3 area 0.0.0.0
#
ospf 3 router-id 4.4.4.4
 import-route static
 area 0.0.0.0
  network 10.10.3.0 0.0.0.3
  network 10.10.4.0 0.0.0.3
#
ip route-static 5.5.5.5 255.255.255.255 10.10.4.2
#

R5

#
interface Ethernet0/0/0
 description to-R5
 ip address 10.10.4.2 255.255.255.252
#

#
interface LoopBack0
 ip address 5.5.5.5 255.255.255.255
#
ip route-static 0.0.0.0 0.0.0.0 10.10.4.1
#

R2与R4引入静态路由,发布详细路由。如果在R2或是R4上做缺省路由,通过default-route-advertise发布后,由于本身的缺省路由比通过OSPF学习到的路由优先级高,到1.1.1或5.5.5.5 地址不可达。

注意:引入或是发布路由,都是自身所存在的路由。比如:引入直连路由,静态路由,缺省路由。


  • 11
    点赞
  • 52
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值