所选语种没有对应资源,请选择:

本站点使用Cookies,继续浏览表示您同意我们使用Cookies。Cookies和隐私政策>

提示

尊敬的用户,您的IE浏览器版本过低,为获取更好的浏览体验,请升级您的IE浏览器。

升级

S1720, S2700, S5700, S6720 V200R010C00 配置指南-IP单播路由

本文档介绍了设备支持的IP单播路由相关配置。主要内容包括IP路由概述,静态路由、RIP、RIPng、OSPF、OSPFv3、IS-IS(IPv4)、IS-IS(IPv6)、BGP、路由策略以及策略路由的基本原理和配置过程,并提供相关的配置案例。
评分并提供意见反馈 :
华为采用机器翻译与人工审校相结合的方式将此文档翻译成不同语言,希望能帮助您更容易理解此文档的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 华为对于翻译的准确性不承担任何责任,并建议您参考英文文档(已提供链接)。
配置OSPF的DR选择示例

配置OSPF的DR选择示例

组网需求

图1所示,部署OSPF协议的网络中有五台交换机,其中Switch作为二层交换机连接其他运行OSPF协议的四台交换机。由于之前四台设备之间缺省选举的DR不符合网络需求,现在需要让SwitchA被选举为DR来和OSPF网络其他设备交互LSA信息,而SwitchC则作为SwitchA的备份。而SwitchB由于其他业务需要,只能让它通过DR来与OSPF网络其他设备交互LSA信息。

图6-70  配置OSPF的DR选择组网图

配置思路

采用如下的思路配置OSPF的DR选择:

  1. 在各交换机上配置OSPF的基本功能,查看四台交换机之间缺省的DR的选举情况。

  2. 配置SwitchA对应接口的DR优先级为100,SwitchB对应接口的DR优先级为0,SwitchC对应接口的DR优先级为2,使得SwitchA被选举为DR,SwitchC被选举为BDR,SwitchB永远无法成为DR或BDR,而SwitchD采用缺省DR优先级,维持原状不变。

操作步骤

  1. 配置各接口所属的VLAN

    # 配置SwitchA。SwitchSwitchB、SwitchC和SwitchD的配置与SwitchA类似。

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchA
    [SwitchA] vlan batch 10
    [SwitchA] interface gigabitethernet 0/0/1
    [SwitchA-GigabitEthernet0/0/1] port link-type trunk
    [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
    [SwitchA-GigabitEthernet0/0/1] quit

  2. 配置各VLANIF接口的IP地址

    # 配置SwitchA。SwitchB、SwitchC和SwitchD的配置与SwitchA类似。

    [SwitchA] interface vlanif 10
    [SwitchA-Vlanif10] ip address 192.168.1.1 24
    [SwitchA-Vlanif10] quit

  3. 配置OSPF基本功能

    # 配置SwitchA。

    [SwitchA] ospf 1 router-id 10.1.1.1
    [SwitchA-ospf-1] area 0
    [SwitchA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
    [SwitchA-ospf-1-area-0.0.0.0] quit
    [SwitchA-ospf-1] quit

    # 配置SwitchB。

    [SwitchB] ospf 1 router-id 10.2.2.2
    [SwitchB-ospf-1] area 0
    [SwitchB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255 
    [SwitchB-ospf-1-area-0.0.0.0] quit
    [SwitchB-ospf-1] quit

    # 配置SwitchC。

    [SwitchC] ospf 1 router-id 10.3.3.3
    [SwitchC-ospf-1] area 0
    [SwitchC-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255 
    [SwitchC-ospf-1-area-0.0.0.0] quit
    [SwitchC-ospf-1] quit

    # 配置SwitchD。

    [SwitchD] ospf 1 router-id 10.4.4.4
    [SwitchD-ospf-1] area 0
    [SwitchD-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255 
    [SwitchD-ospf-1-area-0.0.0.0] quit
    [SwitchD-ospf-1] quit
    [SwitchD] quit

    # SwitchA上查看OSPF邻居的信息。

    [SwitchA] display ospf peer
    
              OSPF Process 1 with Router ID 10.1.1.1
                      Neighbors
    
     Area 0.0.0.0 interface 192.168.1.1(Vlanif10)'s neighbors
     Router ID: 10.2.2.2      Address: 192.168.1.2
    State: 2-Way  Mode:Nbr is  Master  Priority: 1
    DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 32  sec
       Retrans timer interval: 5
       Neighbor is up for 00:04:21
       Authentication Sequence: [ 0 ]
    
     Router ID: 10.3.3.3      Address: 192.168.1.3
    State: Full  Mode:Nbr is  Master  Priority: 1
    DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 37  sec
       Retrans timer interval: 5
       Neighbor is up for 00:04:06
       Authentication Sequence: [ 0 ]
    
     Router ID: 10.4.4.4      Address: 192.168.1.4
    State: Full  Mode:Nbr is  Master  Priority: 1
    DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 37  sec
       Retrans timer interval: 5
       Neighbor is up for 00:03:53
       Authentication Sequence: [ 0 ]

    从以上回显中可以看到在缺省情况下SwitchD为DR,SwitchC为BDR。这是因为当DR优先级相同时,Router-ID高的被选举为DR。

  4. 配置交换机接口上的DR优先级

    # 配置SwitchA。

    [SwitchA] interface vlanif 10
    [SwitchA-Vlanif10] ospf dr-priority 100
    [SwitchA-Vlanif10] quit
    [SwitchA] quit

    # 配置SwitchB。

    [SwitchB] interface vlanif 10
    [SwitchB-Vlanif10] ospf dr-priority 0
    [SwitchB-Vlanif10] quit
    [SwitchB] quit

    # 配置SwitchC。

    [SwitchC] interface vlanif 10
    [SwitchC-Vlanif10] ospf dr-priority 2
    [SwitchC-Vlanif10] quit
    [SwitchC] quit

    # 在SwitchD上查看OSPF邻居的信息。

    <SwitchD> display ospf peer
    
              OSPF Process 1 with Router ID 10.4.4.4
                      Neighbors
    
     Area 0.0.0.0 interface 192.168.1.4(Vlanif10)'s neighbors
     Router ID: 10.1.1.1      Address: 192.168.1.1
       State: Full  Mode:Nbr is  Slave  Priority: 100
    DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 31  sec
       Retrans timer interval: 5
       Neighbor is up for 00:11:17
       Authentication Sequence: [ 0 ]
    
     Router ID: 10.2.2.2      Address: 192.168.1.2
       State: Full  Mode:Nbr is  Slave  Priority: 0
    DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 35  sec
       Retrans timer interval: 5
       Neighbor is up for 00:11:19
       Authentication Sequence: [ 0 ]
    
     Router ID: 10.3.3.3      Address: 192.168.1.3
       State: Full  Mode:Nbr is  Slave  Priority: 2
    DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 33  sec
       Retrans timer interval: 5
       Neighbor is up for 00:11:15
       Authentication Sequence: [ 0 ]

    通过以上回显信息发现四台交换机之间DR的选举情况并没有改变。这是因为如果DR、BDR已经选择完毕,当一台新设备加入后,即使它的DR优先级值最大,也不会立即成为该网段中的DR,只有重启OSPF进程之后才会重新选举DR和BDR。

  5. 重启OSPF进程

    # 在各交换机的用户视图下,同时执行命令reset ospf 1 process,以重启OSPF进程。同时重启OSPF进程是为了让四台交换机都参与DR和BDR的选举过程。

    # 重启SwitchA

    <SwitchA> reset ospf 1 process

    # 重启SwitchB

    <SwitchB> reset ospf 1 process

    # 重启SwitchC

    <SwitchC> reset ospf 1 process

    # 重启SwitchD

    <SwitchD> reset ospf 1 process

  6. 验证配置结果

    # 在SwitchD上查看OSPF邻居信息。

    <SwitchD> display ospf peer
    
              OSPF Process 1 with Router ID 10.4.4.4
                      Neighbors
    
     Area 0.0.0.0 interface 192.168.1.4(Vlanif10)'s neighbors
     Router ID: 10.1.1.1      Address: 192.168.1.1
    State: Full  Mode:Nbr is  Slave  Priority: 100
    DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 35  sec
       Retrans timer interval: 5
       Neighbor is up for 00:07:19
       Authentication Sequence: [ 0 ]
    
     Router ID: 10.2.2.2      Address: 192.168.1.2
    State: 2-Way  Mode:Nbr is  Master  Priority: 0
    DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 35  sec
       Retrans timer interval: 5
       Neighbor is up for 00:07:19
       Authentication Sequence: [ 0 ]
    
     Router ID: 10.3.3.3      Address: 192.168.1.3
    State: Full  Mode:Nbr is  Slave  Priority: 2
    DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 37  sec
       Retrans timer interval: 5
       Neighbor is up for 00:07:17
       Authentication Sequence: [ 0 ]
    
    

    从以上回显中可以看到SwitchA被选举为DR,SwitchC为BDR。而SwitchD与SwitchB之间的邻居状态为2-Way,这说明两者既不是DR,也不是BDR,即它们之间不需要交换LSA信息。

配置文件

  • Switch的配置文件

    #
    sysname Switch
    #
    vlan batch 10
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface GigabitEthernet0/0/3
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface GigabitEthernet0/0/4
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    return
  • SwitchA的配置文件

    #
    sysname SwitchA
    #
    vlan batch 10
    #
    interface Vlanif10
     ip address 192.168.1.1 255.255.255.0
     ospf dr-priority 100
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    ospf 1 router-id 10.1.1.1
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
    #
    return
  • SwitchB的配置文件

    #
    sysname SwitchB
    #
    vlan batch 10
    #
    interface Vlanif10
     ip address 192.168.1.2 255.255.255.0
     ospf dr-priority 0
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    ospf 1 router-id 10.2.2.2
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
    #
    return
  • SwitchC的配置文件

    #
    sysname SwitchC
    #
    vlan batch 10
    #
    interface Vlanif10
     ip address 192.168.1.3 255.255.255.0
     ospf dr-priority 2
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    ospf 1 router-id 10.3.3.3
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
    #
    return
  • SwitchD的配置文件

    #
    sysname SwitchD
    #
    vlan batch 10
    #
    interface Vlanif10
     ip address 192.168.1.4 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    ospf 1 router-id 10.4.4.4
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
    #
    return
翻译
下载文档
更新时间:2019-04-17

文档编号:EDOC1000141402

浏览量:22430

下载量:1345

平均得分:
本文档适用于这些产品
相关文档
相关版本
分享
上一页 下一页