通过配置OSPF虚链路连接到骨干区域。


实验拓扑

如图所示连接,地址规划如下:

名称 接口 IP地址
R1 f0/0 192.168.10.1/24
R1 f0/1 192.168.20.1/24
R2 f0/0 192.168.20.2/24
R2 f0/1 192.168.30.1/24
R3 f0/0 192.168.30.2/24
R3 f0/1 192.168.40.1/24
R4 f0/0 192.168.40.2/24
R4 f0/1 192.168.50.1/24
PC1 e0 192.168.10.2/24
PC2 e0 192.168.50.2/24

配置方法

R2(config)#router ospf 1
R2(config-router)#area 1 virtual-link 3.3.3.3
R2(config-router)#ex

配置过程

R1

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int f0/0
R1(config-if)#ip add 192.168.10.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#int f0/1
R1(config-if)#ip add 192.168.20.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#int loopback 0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.10.0 0.0.0.255 area 2
R1(config-router)#network 192.168.20.0 0.0.0.255 area 2
R1(config-router)#ex

R2

R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int f0/0
R2(config-if)#ip add 192.168.20.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#ex
R2(config)#int f0/1
R2(config-if)#ip add 192.168.30.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#ex
R2(config)#int loopback 0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#no sh
R2(config-if)#ex
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.168.20.0 0.0.0.255 area 2
R2(config-router)#network 192.168.30.0 0.0.0.255 area 1
R2(config-router)#ex

R3

R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#int f0/0
R3(config-if)#ip add 192.168.30.2 255.255.255.0
R3(config-if)#no sh
R3(config-if)#ex
R3(config)#int f0/1
R3(config-if)#ip add 192.168.40.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#ex
R3(config)#int loopback 0
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#no sh
R3(config-if)#ex
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 192.168.30.0 0.0.0.255 area 1
R3(config-router)#network 192.168.40.0 0.0.0.255 area 0
R3(config-router)#ex

R4

R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#int f0/0
R4(config-if)#ip add 192.168.40.2 255.255.255.0
R4(config-if)#no sh
R4(config-if)#ex
R4(config)#int f0/1
R4(config-if)#ip add 192.168.50.1 255.255.255.0
R4(config-if)#no sh
R4(config-if)#ex
R4(config)#int loopback 0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#no sh
R4(config-if)#ex
R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.4
R4(config-router)#network 192.168.40.0 0.0.0.255 area 0
R4(config-router)#network 192.168.50.0 0.0.0.255 area 0
R4(config-router)#ex

第一次查看路由表

  • R1
R1(config)#do show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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
C 1.1.1.1 is directly connected, Loopback0
C 192.168.10.0/24 is directly connected, FastEthernet0/0
C 192.168.20.0/24 is directly connected, FastEthernet0/1
  • R2
R2(config)#do show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
C 192.168.30.0/24 is directly connected, FastEthernet0/1
O 192.168.10.0/24 [110/20] via 192.168.20.1, 00:09:52, FastEthernet0/0
O IA 192.168.40.0/24 [110/20] via 192.168.30.2, 00:05:59, FastEthernet0/1
C 192.168.20.0/24 is directly connected, FastEthernet0/0
O IA 192.168.50.0/24 [110/30] via 192.168.30.2, 00:01:42, FastEthernet0/1
  • R3
R3(config)#do show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
C 192.168.30.0/24 is directly connected, FastEthernet0/0
C 192.168.40.0/24 is directly connected, FastEthernet0/1
O 192.168.50.0/24 [110/20] via 192.168.40.2, 00:02:01, FastEthernet0/1
  • R4
R4(config)#do show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 IA 192.168.30.0/24 [110/20] via 192.168.40.1, 00:02:27, FastEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
C 192.168.40.0/24 is directly connected, FastEthernet0/0
C 192.168.50.0/24 is directly connected, FastEthernet0/1

配置虚链路

R2(config)#router ospf 1
R2(config-router)#area 1 virtual-link 3.3.3.3
R2(config-router)#ex
R3(config)#router ospf 1
R3(config-router)#area 1 virtual-link 2.2.2.2
R3(config-router)#ex

第二次查看路由表

R1(config)#do show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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
C 1.1.1.1 is directly connected, Loopback0
O IA 192.168.30.0/24 [110/20] via 192.168.20.2, 00:02:08, FastEthernet0/1
C 192.168.10.0/24 is directly connected, FastEthernet0/0
O IA 192.168.40.0/24 [110/30] via 192.168.20.2, 00:01:27, FastEthernet0/1
C 192.168.20.0/24 is directly connected, FastEthernet0/1
O IA 192.168.50.0/24 [110/40] via 192.168.20.2, 00:01:27, FastEthernet0/1
R2(config)#do show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
C 192.168.30.0/24 is directly connected, FastEthernet0/1
O 192.168.10.0/24 [110/20] via 192.168.20.1, 00:02:19, FastEthernet0/0
O 192.168.40.0/24 [110/20] via 192.168.30.2, 00:01:33, FastEthernet0/1
C 192.168.20.0/24 is directly connected, FastEthernet0/0
O 192.168.50.0/24 [110/30] via 192.168.30.2, 00:01:33, FastEthernet0/1
R3(config)#do show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
C 192.168.30.0/24 is directly connected, FastEthernet0/0
O IA 192.168.10.0/24 [110/30] via 192.168.30.1, 00:01:39, FastEthernet0/0
C 192.168.40.0/24 is directly connected, FastEthernet0/1
O IA 192.168.20.0/24 [110/20] via 192.168.30.1, 00:01:39, FastEthernet0/0
O 192.168.50.0/24 [110/20] via 192.168.40.2, 00:08:17, FastEthernet0/1
R4(config)#do show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 IA 192.168.30.0/24 [110/20] via 192.168.40.1, 00:08:32, FastEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
O IA 192.168.10.0/24 [110/40] via 192.168.40.1, 00:01:34, FastEthernet0/0
C 192.168.40.0/24 is directly connected, FastEthernet0/0
O IA 192.168.20.0/24 [110/30] via 192.168.40.1, 00:01:34, FastEthernet0/0
C 192.168.50.0/24 is directly connected, FastEthernet0/1

验证结果

配置 IP 地址

PC1> ip 192.168.10.2 192.168.10.1
Checking for duplicate address...
PC1 : 192.168.10.2 255.255.255.0 gateway 192.168.10.1
PC2> ip 192.168.50.2 192.168.50.1
Checking for duplicate address...
PC1 : 192.168.50.2 255.255.255.0 gateway 192.168.50.1

ping 测试

PC1> ping 192.168.50.2
192.168.50.2 icmp_seq=1 timeout
84 bytes from 192.168.50.2 icmp_seq=2 ttl=60 time=85.890 ms
84 bytes from 192.168.50.2 icmp_seq=3 ttl=60 time=80.743 ms
84 bytes from 192.168.50.2 icmp_seq=4 ttl=60 time=83.772 ms
84 bytes from 192.168.50.2 icmp_seq=5 ttl=60 time=85.761 ms
PC2> ping 192.168.10.2
84 bytes from 192.168.10.2 icmp_seq=1 ttl=60 time=76.961 ms
84 bytes from 192.168.10.2 icmp_seq=2 ttl=60 time=84.788 ms
84 bytes from 192.168.10.2 icmp_seq=3 ttl=60 time=79.753 ms
84 bytes from 192.168.10.2 icmp_seq=4 ttl=60 time=77.792 ms
84 bytes from 192.168.10.2 icmp_seq=5 ttl=60 time=83.964 ms

OSPF 虚链路的更多相关文章

  1. OSPF虚链路配置.示例2

    先看一个拓扑图 黄色区域是area0,即骨干区域,如果如图示RT1与RT6之间的链路断了,那么会出现骨干区域被“分裂”的情况,很明显骨干区域是不能被分割开的,出现这种状况的时候可能会影响到整个自制系统 ...

  2. OSPF虚链路配置.示例1

      在OSPF 网络中,区域0为骨干区域,其它的为非骨干区域,非骨干区域必须与骨干区域直接相连. 根据拓扑图可看到区域1与骨干区域0直接相连而区域2与骨干区域没有直接相连,这种情况下我们可以创建一条虚 ...

  3. rip是典型的距离矢量动态路由协议。Ospf是链路状态型的协议

    网络工程师十个常见面试问题-看准网 https://m.kanzhun.com/k-mianshiwenti/1465113.html 两者都属于IGP协议,rip是典型的距离矢量动态路由协议.Osp ...

  4. H3C 显示OSPF的链路状态数据库

  5. OSPF 高级实验

    一.环境准备 1. 软件:GNS3 2. 路由:c7200 二.实验操作 实验要求: 1.理解 OSPF 虚链路原理及何时需要使用虚链路. 2.掌握 OSPF 虚链路配置方法. 3.掌握 OSPF 的 ...

  6. OSPF详解

    OSPF 详解 (1) [此博文包含图片] (2013-02-04 18:02:33) 转载 ▼ 标签: 端的 第二 以太 第一个 正在 目录 序言 初学乍练 循序渐进学习OSPF 朱皓 入门之前 了 ...

  7. 1.4-动态路由协议OSPF③

    OSPF的路由汇总 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                         用默认的网络地址 因为 无论在何种路 ...

  8. OSPF及实验

    OSPF:Open Shortest Path First,最短路径优先1)基本概念:标准的LS型协议--共享拓扑组播更新:224.0.0.5/6触发更新,存在周期更新  30minOSPF是跨层封装 ...

  9. OSPF路由协议详解

    OSPF:开放式最短路径优先协议无类别链路状态路由协议,组播更新224.0.0.5/6:跨层封装到三层,协议号89:基于拓扑工作,故更新量大-----需要结构化部署–区域划分.地址规划触发更新.每30 ...

随机推荐

  1. 爬虫之selenium模块chrome版本映射表

    驱动及版本对应关系如下: 驱动下载路径见底部: chromedriver版本 支持的Chrome版本v2.43 v69-71v2.42 v68-70v2.41 v67-69v2.40 v66-68v2 ...

  2. Java 集合系列之六:工具类Collections和Arrays基本操作

    1. Collections Collections类主要是完成了两个主要功能 提供了若干简单而又有用的算法,比如排序,二分查找,求最大最小值等等. 提供对集合进行包装的静态方法.比如把指定的集合包装 ...

  3. docker-compose可持续集成之jenkins

    1.下载docker-compose curl -L https://get.daocloud.io/docker/compose/releases/download/1.24.1/docker-co ...

  4. Haskell-chp01

    -- 函数名首字母必须小写,可以包含 '来表示该函数严格求值版本(与惰性求值相对) doubleMe x = x + x doubleUs x y = doubleMe x + doubleMe y ...

  5. c++ builder调用sql server的存储过程进行数据的下载和上传

    小小的几行代码,在这里搞了一天.好好的一个周六过的无比的难受.代码很简单,但是主要原因是因为在用合作商的软件上传数据的时候有些框框没有勾选. come on....... 1.用两个控件ADOConn ...

  6. 你不知道的js——数组 join

    你可能对使用数组的 join 方法已经轻车熟路,但你也许不知道: 10.If element0 is undefined or null, let R be the empty String; oth ...

  7. spring cloud 客户端负载均衡 - Ribbon

    Spring Cloud Ribbon是一个基于HTTP和TCP的客户端负载均衡工具,基于Netflix Ribbon实现的,Ribbon不像注册中心.网关那样需要单独部署,它是作为一个工具直接集成到 ...

  8. STL源码剖析——序列式容器#5 heap

    准确来讲,heap并不属于STL容器,但它是其中一个容器priority queue必不可少的一部分.顾名思义,priority queue就是优先级队列,允许用户以任何次序将任何元素加入容器内,但取 ...

  9. 利用Travis IC实现Hexo博客自动化部署

    1.Hexo博客的利与弊 Hexo中文 我就默认为看到这篇文章的人都比较了解Hexo博客,也都能够成功手动部署吧.所以第一部分推荐两篇文章一笔带过,让我们快速进入本文的重点内容.实在不知道也不要方先看 ...

  10. Mysql——查看数据库,表占用磁盘大小

    .查询所有数据库占用磁盘空间大小 select TABLE_SCHEMA, concat(,),' MB') as data_size, concat(,),'MB') as index_size f ...