关于import-route static 和default-route-advertise区别知识总结

一、相关解释

import-route static  命令不能引入外部路由的默认路由,OSPF通过路由表更新学习到外部路由的默认路由,

如果外部路由的默认路由需要在OSPF普通区域中发布,需要执行default-route-advertise 命令。

在正常情况下,构建OSPF协议运行体系,在外围网络设备中,对外部路由的注入OSPF,有两种独立的方法:

静态路由的引入用 import-route static,而默认路由用 default-route-advertise 引入,执行的位置都是在OSPF里。

    这里需要注意的是,当外网特别不稳定时,防止OSPF反复计算,可设置 default-route-advertise always,其实就是管您外网状况如何,我当您正常并一直运行。

        ***  别纠结,他这样做应该是研发人员碰到的不得已的问题,只能区别对待这两种情况,相对于对静态路由,为默认路由 0.0.0.0  0.0.0.0单独设计了一条命令,有点奢侈。:)

      在网上收集到网友这样的解释,我认为是说的通的:协议设计上的规定,用来防范意外环路的。防止引入静态路由时注入默认路由,产生环路

二、相关验证

1.ENSP模型

2.基本配置

工作站IP地址配置,路由器接口配置,交换机vlan配置,vlan的虚接口IP地址配置

R1配置

#
interface GigabitEthernet0/0/0
ip address 192.168.20.254 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.19.1 255.255.255.0

R9配置

#
interface GigabitEthernet0/0/0
ip address 192.168.19.9 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.95.9 255.255.255.0

ip route-static 0.0.0.0 0.0.0.0 192.168.19.1  //末端路由器的默认路由配置

交换机配置

vlan batch 10 95

#
interface Vlanif10
ip address 192.168.50.254 255.255.255.0
#
interface Vlanif95
ip address 192.168.95.10 255.255.255.0

3.OSPF配置

R1配置

#
ospf 1 router-id 20.1.1.0
area 0.0.0.20
network 192.168.12.0 0.0.0.255
network 192.168.13.0 0.0.0.255
network 192.168.19.0 0.0.0.255
network 192.168.20.0 0.0.0.255

R9配置

#
ospf 1 router-id 20.1.9.0
default-route-advertise   //这一条命令就是针对R9的默认路由的,将默认路由注入OSPF,并通过LSA报文传给其他相关方
area 0.0.0.20
network 192.168.19.0 0.0.0.255
network 192.168.95.0 0.0.0.255

交换配置

#
ospf 1 router-id 20.1.10.0
area 0.0.0.20
network 192.168.95.0 0.0.0.255
network 192.168.50.0 0.0.0.255

4.连通测试

[R9]dis ospf lsdb

OSPF Process 1 with Router ID 20.1.9.0
Link State Database

Area: 0.0.0.20
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 20.1.9.0 20.1.9.0 1103 48 8000000D 1
Router 20.1.10.0 20.1.10.0 1060 48 80000005 1
Router 20.1.1.0 20.1.1.0 659 72 8000000E 1
Network 192.168.95.9 20.1.9.0 1103 32 80000002 0
Network 192.168.19.1 20.1.1.0 659 32 80000003 0

AS External Database

Type LinkState ID AdvRouter Age Len Sequence Metric
External 0.0.0.0 20.1.9.0 1438 36 80000001 1
External 192.168.40.0 30.3.70.0 1541 36 80000002 1

[SW1]dis ospf lsdb

OSPF Process 1 with Router ID 20.1.10.0
Link State Database

Area: 0.0.0.20
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 20.1.9.0 20.1.9.0 1273 48 8000000D 1
Router 20.1.10.0 20.1.10.0 1227 48 80000005 1
Router 20.1.1.0 20.1.1.0 829 72 8000000E 1
Network 192.168.95.9 20.1.9.0 1273 32 80000002 0
Network 192.168.19.1 20.1.1.0 829 32 80000003 0

AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 0.0.0.0 20.1.9.0 1607 36 80000001 1   //通过协议,其它设备已经学到的。
External 192.168.40.0 30.3.70.0 1710 36 80000002 1

PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fefe:445a
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.20.1
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.20.254
Physical address..................: 54-89-98-FE-44-5A
DNS server........................:

PC>ping 192.168.50.1  //连通测试正常

Ping 192.168.50.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.50.1: bytes=32 seq=2 ttl=125 time=63 ms
From 192.168.50.1: bytes=32 seq=3 ttl=125 time=31 ms
From 192.168.50.1: bytes=32 seq=4 ttl=125 time=62 ms
From 192.168.50.1: bytes=32 seq=5 ttl=125 time=47 ms

--- 192.168.50.1 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/50/63 ms

关于import-route static 和default-route-advertise区别知识总结的更多相关文章

  1. 002 static and default route

    r2(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1 r1(config)#ip route 192.168.3.0 255.255.25 ...

  2. Default route and zero route

    A default route of a computer that is participating in computer networking is the packet forwarding ...

  3. FreeBSD Set a Default Route / Gateway

    Task: View / Display FreeBSD Routing Table Use netstat command with -r option:$ netstat -r$ netstat ...

  4. Part 28 AngularJS default route

    At the moment the problem is that, if you try to navigate to a route that is not configured, you wil ...

  5. 路由传值及获取参数,路由跳转,路由检测,this.$route.query和this.$route.params接收参数,HttpGet请求拼接url参数

    配置动态路由参数id: routes: [ // 动态路径参数 以冒号开头 { path: '/user/:id', component: User } ] html路由跳转: <router- ...

  6. Difference Between static and default methods in interface

    I was learning through interfaces when I noticed that you can now define static and default methods ...

  7. ES6:export default 和 export 区别

    export default 和 export 区别: 1.export与export default均可用于导出常量.函数.文件.模块等 2.你可以在其它文件或模块中通过import+(常量 | 函 ...

  8. Java中static final 与 final 的区别(转载)

    转自:http://advance0683.iteye.com/blog/1107732 Java中static final 与 final 的区别: 例子: Java代码 import java.u ...

  9. import,reload,__import__在python中的区别

    import,reload,__import__在python中的区别 http://blog.csdn.net/five3/article/details/7762870 import作用:导入/引 ...

  10. PHP中new static()与new self()的区别异同分析

    本文实例讲述了PHP中new static()与new self()的区别异同,相信对于大家学习PHP程序设计能够带来一定的帮助. 问题的起因是本地搭建一个站.发现用PHP 5.2 搭建不起来,站PH ...

随机推荐

  1. KMP字符串 AcWing 831

    题目:https://www.acwing.com/problem/content/833/ 题意:求子串在母串中每次出现时的下标位置. 题解:哈哈哈,敲题时想到之前看到一个人叫 kmp 算法为 看毛 ...

  2. 取出每个分组的的第一条数据sql

    select * from(select id,detail, ROW_NUMBER()over(PARTITION By detail ORDER BY detail DESC) as rnfrom ...

  3. CSS transform: scale()

    前言 transform属性允许你旋转,缩放,倾斜或平移给定元素.其中scale(x, y)就是实现元素缩放的属性值. scale(x, y)的 x 乘以原本元素的 x:y 乘以原本的元素 y,就可以 ...

  4. 从0搭建Vue3组件库(三): 组件库的环境配置

    本篇文章将在项目中引入 typescript,以及手动搭建一个用于测试组件库组件 Vue3 项目 因为我们是使用 Vite+Ts 开发的是 Vue3 组件库,所以我们需要安装 typescript.v ...

  5. CF生化全模式全装备单机版安装教程(基于CSOL)

    喜欢玩CF单机版的朋友平时应该接触过一些基于CS1.6的单机版,但是这种版本有些特性就是:改了分辨率就容易进不去游戏:变为幽灵时被枪射击时会出现视角乱晃的情况:游戏过程中场景宏大变数多时容易突然退出回 ...

  6. 解读gitee上的vue3开源项目,并记录不熟悉的API

    1.vue中的getCurrentInstance: 在Vue3中,getCurrentInstance()可以用来获取当前组件实例: 2.vue中使用mitt实现兄弟组件传值: 在vue3中$on, ...

  7. python使用pysimplegui简单制作一个exe程序

    一.安装打包程序 控制台输入: pip install pysimplegui-exemaker -- 安装exe制作库 pip install PySimpleGUI -- 安装图形化界面编辑库 二 ...

  8. Mysql昨天,上个月条件查询

    1.查询昨日数据 SELECT * FROM test WHERE DATEDIFF(DATE_FORMAT(NOW(),'%Y%m%d'),DATE_FORMAT(created_time,'%Y% ...

  9. CSS实现开门效果

    .door{ position: relative; width: 450px; height: 300px; border: 1px solid #000; margin: 100px auto; ...

  10. echart地图引入路径问题

    曾经echart某个地图整体引入,好多的引入的文件找不到,这是因为servlet在做jsp解析的时候路径变了,解决方案:先将本地返回的视图跳转一个本地的a.jsp页面,然后再从a.jsp页面跳转到引入 ...