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 地址不可达。
注意:引入或是发布路由,都是自身所存在的路由。比如:引入直连路由,静态路由,缺省路由。
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 地址不可达。
注意:引入或是发布路由,都是自身所存在的路由。比如:引入直连路由,静态路由,缺省路由。
相关文章推荐
- hive web界面安装详细安装步骤
- 【分布式】Zookeeper应用场景
- 百度地图在处理不同形式的点时互相不影响的实现思路
- 【MFC】UpData()函数更新控件中的内容
- PHP7和PHP5.6在foreach里面使用current的区别
- Yum离线安装(一) --- RPM 打包技术与典型 SPEC 文件分析
- 2017.1.16【初中部 】普及组模拟赛C组 match 题解
- Oracle——存储过程
- Android 笔记:识别银行卡,获取银行卡卡号
- mac下virtualbox配置全网通
- 栅格分类---自然间断点 出错!NaturalBreaksClass
- iTop4412之I2C裸机操作
- Android自定义View之ProgressBar出场记
- mysql持续学习
- linux shell 输入输出重定向 分析
- 为什么在函数的声明后面还有一个 const? 如:void fun() const;
- canvas下雪
- 【Leetcode】448. Find All Numbers Disappeared in an Array
- python openpyxl练习--打印九九乘法表到excel中。
- poj_3321 Apple Tree(dfs序+树状数组)