ospf的虚连接配置
作者:邓聪聪
配置OSPF虚连接
组网需求
在图1中,Area2没有与骨干区域直接相连。Area1被用作传输区域(Transit Area)来连接Area2和Area0。SwitchA、SwitchB之间配置一条虚连接。

|
Switch |
接口 |
对应的VLANIF |
IP地址 |
|
SwitchA |
GigabitEthernet1/0/1 |
VLANIF 10 |
192.168.1.1/24 |
|
SwitchA |
GigabitEthernet1/0/2 |
VLANIF 20 |
10.1.1.1/8 |
|
SwitchB |
GigabitEthernet1/0/1 |
VLANIF 10 |
192.168.1.2/24 |
|
SwitchB |
GigabitEthernet1/0/2 |
VLANIF 30 |
172.16.1.1/16 |
|
SwitchC |
GigabitEthernet1/0/1 |
VLANIF 20 |
10.1.1.2/8 |
|
SwitchD |
GigabitEthernet1/0/1 |
VLANIF 30 |
172.16.1.2/16 |
配置思路
采用如下的思路配置OSPF虚连接:
在各Switch上使能OSPF,配置OSPF基本功能。
在SwitchA、SwitchB上配置虚连接,使非骨干区域与骨干区域连通。
数据准备
为完成此配置例,需准备如下的数据:
- 各接口所属的VLAN ID,具体数据如图1所示。
- 各VLANIF接口的IP地址,具体数据如图1所示。
各Switch设备的Router ID,OSPF进程号以及各接口所属的区域。
- SwitchA的Router ID 1.1.1.1,运行的OSPF进程号1,区域1的网段192.168.1.0/24,区域0的网段10.0.0.0/8。
- SwitchB的Router ID 2.2.2.2,运行的OSPF进程号1,区域1的网段192.168.1.0/24,区域2的网段172.16.0.0/16。
- SwitchC的Router ID 3.3.3.3,运行的OSPF进程号1,区域0的网段10.0.0.0/8。
- SwitchD的Router ID 4.4.4.4,运行的OSPF进程号1,区域2的网段172.16.0.0/16。
操作步骤
- 配置各接口所属VLAN
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 10 20
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1]port hybrid pvid vlan 10
[SwitchA-GigabitEthernet1/0/1]port hybrid untagged vlan 10
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port hybrid pvid vlan 20
[SwitchA-GigabitEthernet1/0/2] port hybrid untagged vlan 20
[SwitchA-GigabitEthernet1/0/2] quitSwitchB、SwitchC、SwitchD的配置同SwitchA(略)
- 配置各VLANIF接口的IP地址
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 192.168.1.1 24
[SwitchA-Vlanif10] quit
[SwitchA] interface vlanif 20
[SwitchA-Vlanif20] ip address 10.1.1.1 8
[SwitchA-Vlanif20] quitSwitchB、SwitchC、SwitchD的配置同SwitchA(略)
- 配置OSPF基本功能
# 配置SwitchA。
[SwitchA] ospf 1 router-id 1.1.1.1
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 10.0.0.0 0.255.255.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] area 1
[SwitchA-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.1] quit
[SwitchA-ospf-1] quit# 配置SwitchB。
[SwitchB] ospf 1 router-id 2.2.2.2
[SwitchB-ospf-1] area 1
[SwitchB-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.1] quit
[SwitchB-ospf-1] area 2
[SwitchB–ospf-1-area-0.0.0.2] network 172.16.0.0 0.0.255.255
[SwitchB–ospf-1-area-0.0.0.2] quit
[SwitchB–ospf-1] quit# 配置SwitchC。
[SwitchC] ospf 1 router-id 3.3.3.3
[SwitchC-ospf-1] area 0
[SwitchC-ospf-1-area-0.0.0.0] network 10.0.0.0 0.255.255.255
[SwitchC-ospf-1-area-0.0.0.0] quit
[SwitchC-ospf-1] quit# 配置SwitchD。
[SwitchD] ospf 1 router-id 4.4.4.4
[SwitchD-ospf-1] area 2
[SwitchD-ospf-1-area-0.0.0.2] network 172.16.0.0 0.0.255.255
[SwitchD-ospf-1-area-0.0.0.2] quit
[SwitchD-ospf-1] quit# 查看SwitchA的OSPF路由表。
[SwitchA] display ospf routing OSPF Process 1 with Router ID 1.1.1.1
Routing Tables Routing for Network
Destination Cost Type NextHop AdvRouter Area
10.0.0.0/8 1 Transit 10.1.1.1 3.3.3.3 0.0.0.0
192.168.1.0/24 1 Transit 192.168.1.1 2.2.2.2 0.0.0.1
Total Nets: 2
Intra Area: 2 Inter Area: 0 ASE: 0 NSSA: 0由于Area2没有与Area0直接相连,所以SwitchA路由表中没有Area2中的路由。
- 配置虚连接
# 配置SwitchA。
[SwitchA] ospf
[SwitchA-ospf-1] area 1
[SwitchA-ospf-1-area-0.0.0.1] vlink-peer 2.2.2.2
[SwitchA-ospf-1-area-0.0.0.1] quit
[SwitchA-ospf-1] quit# 配置SwitchB。
[SwitchB] ospf 1
[SwitchB-ospf-1] area 1
[SwitchB-ospf-1-area-0.0.0.1] vlink-peer 1.1.1.1
[SwitchB-ospf-1-area-0.0.0.1] quit
[SwitchB-ospf-1] quit - 验证配置结果
# 查看SwitchA的OSPF路由表。
[SwitchA] display ospf routing OSPF Process 1 with Router ID 1.1.1.1
Routing Tables Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.0.0/16 2 Inter-area 192.168.1.2 2.2.2.2 0.0.0.0
10.0.0.0/8 1 Transit 10.1.1.1 1.1.1.1 0.0.0.0
192.168.1.0/24 1 Transit 192.168.1.1 2.2.2.2 0.0.0.1 Total Nets: 3
Intra Area: 2 Inter Area: 1 ASE: 0 NSSA: 0
配置文件
SwitchA的配置文件
#
sysname SwitchA
#
vlan batch 10 20
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif20
ip address 10.1.1.1 255.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 10
port hybrid untagged vlan 10
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 20
port hybrid untagged vlan 20
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 10.0.0.0 0.255.255.255
area 0.0.0.1
network 192.168.1.0 0.0.0.255
vlink-peer 2.2.2.2
#
returnSwitchB的配置文件
#
sysname SwitchB
#
vlan batch 10 30
#
interface Vlanif10
ip address 192.168.1.2 255.255.255.0
#
interface Vlanif30
ip address 172.16.1.1 255.255.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 10
port hybrid untagged vlan 10
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 30
port hybrid untagged vlan 30
#
ospf 1 router-id 2.2.2.2
area 0.0.0.1
network 192.168.1.0 0.0.0.255
vlink-peer 1.1.1.1
area 0.0.0.2
network 172.16.0.0 0.0.255.255
#
returnSwitchC的配置文件
#
sysname SwitchC
#
vlan 20
#
interface Vlanif20
ip address 10.1.1.2 255.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 20
port hybrid untagged vlan 20
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 10.0.0.0 0.255.255.255
#
returnSwitchD的配置文件
#
sysname SwitchD
#
vlan 30
#
interface Vlanif30
ip address 172.16.1.2 255.255.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 30
port hybrid untagged vlan 30
#
ospf 1 router-id 4.4.4.4
area 0.0.0.2
network 172.16.0.0 0.0.255.255
#
return
ospf的虚连接配置的更多相关文章
- OSPF虚链路配置.示例2
先看一个拓扑图 黄色区域是area0,即骨干区域,如果如图示RT1与RT6之间的链路断了,那么会出现骨干区域被“分裂”的情况,很明显骨干区域是不能被分割开的,出现这种状况的时候可能会影响到整个自制系统 ...
- OSPF的基本配置及DR /BDR选举的实验
OSPF的基本配置及DR /BDR选举的实验 实验拓扑: 实验目的:掌握OSPF的基本配置 掌握手工指定RID 掌握如何修改OSPF的接口优先级 观察DR BDR选举的过程 实验要求:R3当选为DR ...
- 神州数码OSPF路由汇总配置
实验要求:掌握OSPF路由汇总配置 拓扑如下 R1 enable 进入特权模式 config 进入全局模式 hostname R1 修改名称 interface s0/1 进入端口 ip addres ...
- OSPF单区域配置
OSPF单区域配置 实验环境:华为模拟器eNSP 现在有这样一个拓扑图: 我想要让R1可以ping通R3,显然目前是不行的: <R1>ping 192.168.2.2 PING 192.1 ...
- OSPF但区域配置
原理概述 实验内容 实验拓扑 实验编址 实验步骤1.基本配置配置完成后,使用ping命令检测 2.部署单区域OSPF网络使用命令ospf创建并运行OSPF 其中1是进程号,如果没有写明进程号,则默认为 ...
- GNS3(1)——OSPF多区域配置
GNS3(1)——OSPF多区域配置 RIP适用于中小网络,比较简单.没有系统内外.系统分区,边界等概念,用到不是分类的路由. OSPF适用于较大规模网络.它把自治系统分成若干个区域,通过系列内外路由 ...
- OSPF虚链路配置.示例1
在OSPF 网络中,区域0为骨干区域,其它的为非骨干区域,非骨干区域必须与骨干区域直接相连. 根据拓扑图可看到区域1与骨干区域0直接相连而区域2与骨干区域没有直接相连,这种情况下我们可以创建一条虚 ...
- OSPF多区域配置
1.配置三台路由器IP R1(config)#INTER S1/0 R1(config-if)#IP ADDress 192.1.12.1 255.255.255.0 R1(config-if)#no ...
- 默认路由、RIPv2、OSPF、EIGRP配置(全网全通)
1:默认路由 遇到问题:给r2配置向右的单项默认路由,通过PC1去ping主机PC2,一直显示Request timed out, 解决方法:r2配置如下: r2(config)#ip route 0 ...
随机推荐
- 时序数据库InfluxDB:简介及安装
在性能测试过程中,对测试结果以及的实时监控与展示也是很重要的一部分.这篇博客,介绍下linux环境下InfluxDB的安装以及功能特点. 官网地址:influxdata 官方文档:influxdb文档 ...
- cpu_ops、suspend_ops、arm_idle_driver以及machine_restart/machine_power_off到底层PSCI Firmware分析
在内核中针对的cpu的操作,比如arm_cpuidle_init.arm_cpuidle_suspend.boot_secondary.secondary_start_kernel.op_cpu_di ...
- Python调用接口的几种方式
1. requests import requests, jsongithub_url = 'https://api.github.com/user/repos'data = json.dumps({ ...
- L1-8 矩阵A乘以B (15 分)
给定两个矩阵A和B,要求你计算它们的乘积矩阵AB.需要注意的是,只有规模匹配的矩阵才可以相乘.即若A有Ra行.Ca列,B有Rb行.Cb列,则只有Ca与Rb相等时,两 ...
- LOJ2514 CEOI2011 Hotel 贪心
传送门 考虑一个贪心:对于所有人群按照收益从大到小排序,对于每一个人群找到当前能够选择的代价最小的房间成为一组可行订单(如果没有就不可行),最后将这些订单按照收益排序,选其中正的前\(o\)大即可.找 ...
- iis+nginx实现负载均衡
简要说明:nginx的简介自行百度. 目的:把用户的请求分到各个服务器减轻压力.nginx把监听的端口的请求平均转到布署了网站的服务器. 一.windows上安装nginx 1.官网下载windows ...
- STL中的set使用方法详细!!!!
1.关于set C++ STL 之所以得到广泛的赞誉,也被很多人使用,不只是提供了像vector, string, list等方便的容器,更重要的是STL封装了许多复杂的数据结构算法和大量常用数据结构 ...
- 解决 AttributeError: 'ForeignKey' object has no attribute 're'
解决办法 # print('rel...',filter_field_obj.re.to.objects.all()) print("rel...", filter_field_o ...
- Data Governance
https://erwin.com/blog/data-preparation-mapping/
- Linux磁盘空间被未知资源耗尽
在linux中,当我们使用rm在linux上删除了大文件,但是如果有进程打开了这个大文件,却没有关闭这个文件的句柄,那么linux内核还是不会释放这个文件的磁盘空间,最后造成磁盘空间占用100%, ...