您的位置:首页 > 其它

OSPF 路由引入以及缺省路由

2017-01-16 17:22 411 查看
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 地址不可达。

注意:引入或是发布路由,都是自身所存在的路由。比如:引入直连路由,静态路由,缺省路由。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: