作者:邓聪聪

配置OSPF虚连接

组网需求

图1中,Area2没有与骨干区域直接相连。Area1被用作传输区域(Transit Area)来连接Area2和Area0。SwitchA、SwitchB之间配置一条虚连接。

图1 配置OSPF虚连接的组网图 
 

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虚连接:

  1. 在各Switch上使能OSPF,配置OSPF基本功能。

  2. 在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。

操作步骤

  1. 配置各接口所属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] quit

    SwitchB、SwitchC、SwitchD的配置同SwitchA(略)

  2. 配置各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] quit

    SwitchB、SwitchC、SwitchD的配置同SwitchA(略)

  3. 配置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中的路由。

  4. 配置虚连接

    # 配置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
  5. 验证配置结果

    # 查看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
    #
    return
  • SwitchB的配置文件

    #
    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
    #
    return
  • SwitchC的配置文件

    #
    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
    #
    return
  • SwitchD的配置文件

    #
    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
 

最新文章

  1. RTMP流媒体播放过程
  2. Thinkphp3.2.3 执行query命令 包括在模板中使用&lt;php&gt; &lt;/php&gt;时 query的使用方法
  3. KIWI Syslog配置
  4. yii 自定义组件的调用
  5. Java集合---HashMap源码剖析
  6. 深入C++中构造函数、拷贝构造函数、赋值操作符、析构函数的调用过程总结
  7. Android Glide加载图片时转换为圆形、圆角、毛玻璃等图片效果
  8. Linux FTP服务器搭建与使用
  9. GitHub使用教程及常见错误解决
  10. 通过ajax提交form表单
  11. Excel VBA批量修改文件夹下的文件名
  12. (转)C++静态库与动态库
  13. Swift—属性观察者-备
  14. 【部分枚举】【3-21个人赛】ProblemH
  15. CentOS 6下配置本地用户访问vsftpd并赋予写权限
  16. 浅谈JS中的浅拷贝与深拷贝
  17. June 30th. 2018, Week 26th. Saturday
  18. 【Android Studio安装部署系列】四十一、Android Studio安装Alibaba Java Coding Guidelines插件(检查代码规范)
  19. JDBC编程六部曲
  20. ffmpeg 推流相关指令

热门文章

  1. Golang 入门系列(八) cron定时任务
  2. Jquery密码强度校验
  3. 小小知识点(六)——算法中的P问题、NP问题、NP完全问题和NP难问题
  4. 播放器更改语言归属地后Cnario player软件无法启动的问题
  5. 打开Player时出现时间格式的错误提示
  6. PHP 5.0~5.6 各版本兼容性的 cURL 文件上传
  7. UC和QQ两个主流浏览器 * 点击触发微信分享到朋友圈或发送给朋友的功能(转载)
  8. mysql-笔记-命名、索引规范
  9. LODOP设置超文本不自动分页的方法
  10. 【XSY3147】子集计数 DFT 组合数学