No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CX11x, CX31x, CX710 (Earlier Than V6.03), and CX91x Series Switch Modules V100R001C10 Configuration Guide 12

The documents describe the configuration of various services supported by the CX11x&CX31x&CX91x series switch modules The description covers configuration examples and function configurations.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuration Examples

Configuration Examples

The section provides BGP configuration examples, including networking requirements, networking diagram, configuration roadmap, and configuration procedure.

Example for Configuring Basic BGP Functions

Networking Requirements

As shown in Figure 7-109, BGP runs between Switch Modulees; an EBGP connection is established between Switch ModuleA and Switch ModuleB; IBGP full-mesh connections are established between Switch ModuleB, Switch ModuleC, and Switch ModuleD.

Figure 7-109 Networking diagram of configuring basic BGP functions



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure IBGP connections between Switch ModuleB, Switch ModuleC, and Switch ModuleD.
  2. Configure an EBGP connection between Switch ModuleA and Switch ModuleB.

Procedure

  1. Configure the VLAN that each interface belongs to.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 50
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 50
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit
    

    The configurations of Switch ModuleB, Switch ModuleC, and Switch ModuleD are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 200.1.1.2 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 50
    [*Switch ModuleA-Vlanif50] ip address 8.1.1.1 8
    [*Switch ModuleA-Vlanif50] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB, Switch ModuleC, and Switch ModuleD are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Configure IBGP connections.

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 65009
    [*Switch ModuleB-bgp] router-id 2.2.2.2
    [*Switch ModuleB-bgp] peer 9.1.1.2 as-number 65009
    [*Switch ModuleB-bgp] peer 9.1.3.2 as-number 65009
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # Configure Switch ModuleC.

    [~Switch ModuleC] bgp 65009
    [*Switch ModuleC-bgp] router-id 3.3.3.3
    [*Switch ModuleC-bgp] peer 9.1.3.1 as-number 65009
    [*Switch ModuleC-bgp] peer 9.1.2.2 as-number 65009
    [*Switch ModuleC-bgp] quit
    [*Switch ModuleC] commit

    # Configure Switch ModuleD.

    [~Switch ModuleD] bgp 65009
    [*Switch ModuleD-bgp] router-id 4.4.4.4
    [*Switch ModuleD-bgp] peer 9.1.1.1 as-number 65009
    [*Switch ModuleD-bgp] peer 9.1.2.1 as-number 65009
    [*Switch ModuleD-bgp] quit
    [*Switch ModuleD] commit

  4. Configure an EBGP connection.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 65008
    [*Switch ModuleA-bgp] router-id 1.1.1.1
    [*Switch ModuleA-bgp] peer 200.1.1.1 as-number 65009
    [*Switch ModuleA-bgp] quit
    [*Switch ModuleA] commit

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 65009
    [~Switch ModuleB-bgp] peer 200.1.1.2 as-number 65008
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # View the status of BGP peers.

    [~Switch ModuleB] display bgp peer
     BGP local router ID : 2.2.2.2
     Local AS number : 65009
     Total number of peers : 3                 Peers in established state : 3
     
      Peer            V    AS  MsgRcvd  MsgSent  OutQ  Up/Down       State   PrefRcv
     
      9.1.1.2         4  65009     49       62     0   00:44:58   Established     0
      9.1.3.2         4  65009     56       56     0   00:40:54   Established     0
      200.1.1.2       4  65008     49       65     0   00:44:03   Established     1

    The preceding command output shows that BGP connections have been established between Switch ModuleB and Switch Modulees.

  5. Configure Switch ModuleA to advertise route 8.0.0.0/8.

    # Configure Switch ModuleA to advertise route 8.0.0.0.

    [~Switch ModuleA] bgp 65008
    [~Switch ModuleA-bgp] ipv4-family unicast
    [~Switch ModuleA-bgp-af-ipv4] network 8.0.0.0 255.0.0.0
    [*Switch ModuleA-bgp-af-ipv4] quit
    [*Switch ModuleA-bgp] quit
    [*Switch ModuleA] commit

    # View the BGP routing table of Switch ModuleA.

    [~Switch ModuleA] display bgp routing-table
     BGP Local router ID is 1.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
     Total Number of Routes: 1
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     *>   8.0.0.0            0.0.0.0         0                     0      i

    # View the BGP routing table of Switch ModuleB.

    [~Switch ModuleB] display bgp routing-table
     BGP Local router ID is 2.2.2.2
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
     Total Number of Routes: 1
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     *>   8.0.0.0            200.1.1.2       0                     0      65008i

    # View the BGP routing table of Switch ModuleC.

    [~Switch ModuleC] display bgp routing-table
     BGP Local router ID is 3.3.3.3
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
      Total Number of Routes: 1
         Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
      i   8.0.0.0            200.1.1.2       0          100        0      65008i

    The preceding command output shows that Switch ModuleC has learned the route to destination 8.0.0.0 in AS 65008. The route, however, is invalid because the next hop 200.1.1.2 of this route is unreachable.

  6. Configure BGP to import direct routes.

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 65009
    [~Switch ModuleB-bgp] ipv4-family unicast
    [*Switch ModuleB-bgp-af-ipv4] import-route direct
    [*Switch ModuleB-bgp-af-ipv4] quit
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # View the BGP routing table of Switch ModuleA.

    [~Switch ModuleA] display bgp routing-table
      BGP Local router ID is 1.1.1.1
      Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
      Total Number of Routes: 4
        Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     *>   8.0.0.0            0.0.0.0         0                     0      i
     *>   9.1.1.0/24         200.1.1.1       0                     0      65009?
     *>   9.1.3.0/24         200.1.1.1       0                     0      65009?
          200.1.1.0          200.1.1.1       0                     0      65009?

    # View the BGP routing table of Switch ModuleC.

    [~Switch ModuleC] display bgp routing-table
     BGP Local router ID is 3.3.3.3
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
     Total Number of Routes: 4
         Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     * i  8.0.0.0            200.1.1.2       0          100        0      65008i
     *>i  9.1.1.0/24         9.1.3.1         0          100        0      ?
       i  9.1.3.0/24         9.1.3.1         0          100        0      ?
     *>i  200.1.1.0          9.1.3.1         0          100        0      ?

    The preceding command output shows that the route to destination 8.0.0.0 becomes valid because the next-hop address of this route is the address of Switch ModuleA.

    # Run the ping 8.1.1.1 command on Switch ModuleC.

    [~Switch ModuleC] ping 8.1.1.1
      PING 8.1.1.1: 56  data bytes, press CTRL_C to break
        Reply from 8.1.1.1: bytes=56 Sequence=1 ttl=254 time=31 ms
        Reply from 8.1.1.1: bytes=56 Sequence=2 ttl=254 time=47 ms
        Reply from 8.1.1.1: bytes=56 Sequence=3 ttl=254 time=31 ms
        Reply from 8.1.1.1: bytes=56 Sequence=4 ttl=254 time=16 ms
        Reply from 8.1.1.1: bytes=56 Sequence=5 ttl=254 time=31 ms
     
      --- 8.1.1.1 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 16/31/47 ms

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10 50
    #
    interface Vlanif10
     ip address 200.1.1.2 255.255.255.0
    #
    interface Vlanif50
     ip address 8.1.1.1 255.0.0.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 50 
    #
    bgp 65008
     router-id 1.1.1.1
     peer 200.1.1.1 as-number 65009
     #
     ipv4-family unicast
      network 8.0.0.0
      peer 200.1.1.1 enable
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 10 20 30
    #
    interface Vlanif10
     ip address 200.1.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 9.1.3.1 255.255.255.0
    #
    interface Vlanif30
     ip address 9.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    bgp 65009
     router-id 2.2.2.2
     peer 9.1.1.2 as-number 65009
     peer 9.1.3.2 as-number 65009
     peer 200.1.1.2 as-number 65008
     #
     ipv4-family unicast
      import-route direct
      peer 9.1.1.2 enable
      peer 9.1.3.2 enable 
      peer 200.1.1.2 enable
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 20 40
    #
    interface Vlanif20
     ip address 9.1.3.2 255.255.255.0
    #
    interface Vlanif40
     ip address 9.1.2.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    bgp 65009
     router-id 3.3.3.3
     peer 9.1.2.2 as-number 65009
     peer 9.1.3.1 as-number 65009
     #
     ipv4-family unicast
      peer 9.1.2.2 enable
      peer 9.1.3.1 enable
    #
    return
  • Configuration file of Switch ModuleD

    #
    sysname Switch ModuleD
    #
    vlan batch 30 40
    #
    interface Vlanif30
     ip address 9.1.1.2 255.255.255.0
    #
    interface Vlanif40
     ip address 9.1.2.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    bgp 65009
     router-id 4.4.4.4
     peer 9.1.1.1 as-number 65009
     peer 9.1.2.1 as-number 65009
     #
     ipv4-family unicast
      peer 9.1.1.1 enable
      peer 9.1.2.1 enable
    #
    return

Example for Configuring Basic BGP4+ Functions

Networking Requirements

As shown in Figure 7-110, there are two ASs: 65008 and 65009. Switch ModuleA belongs to AS 65008, and Switch ModuleB, Switch ModuleC, and Switch ModuleD belong to AS 65009. Routing Protocol is required to exchange the routing information between the two ASs.

Figure 7-110 Networking diagram for configuring basic BGP4+ functions

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure IBGP connections between Switch ModuleB, Switch ModuleC, and Switch ModuleD.

  2. Configure an EBGP connection between Switch ModuleA and Switch ModuleB.

Procedure

  1. Add interfaces to VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 20
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA]interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB, Switch ModuleC, and Switch ModuleD are similar to the configuration of Switch ModuleA and are not mentioned here.

  2. Enable the IPv6 forwarding capability, and assign an IPv6 address for each interface. The following is the configuration of Switch ModuleA. The configurations of other Switch Modulees are similar to the configuration of Switch ModuleA and are not mentioned here.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ipv6 enable
    [*Switch ModuleA-Vlanif10] ipv6 address 8::1/64
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ipv6 enable
    [*Switch ModuleA-Vlanif20] ipv6 address 10::2/64
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] commit

  3. Configure IBGP.

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 65009
    [*Switch ModuleB-bgp] router-id 2.2.2.2
    [*Switch ModuleB-bgp] peer 9:1::2 as-number 65009
    [*Switch ModuleB-bgp] peer 9:3::2 as-number 65009
    [*Switch ModuleB-bgp] ipv6-family unicast
    [*Switch ModuleB-bgp-af-ipv6] peer 9:1::2 enable
    [*Switch ModuleB-bgp-af-ipv6] peer 9:3::2 enable
    [*Switch ModuleB-bgp-af-ipv6] network 9:1:: 64
    [*Switch ModuleB-bgp-af-ipv6] network 9:3:: 64
    [*Switch ModuleB-bgp-af-ipv6] quit
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # Configure Switch ModuleC.

    [~Switch ModuleC] bgp 65009
    [*Switch ModuleC-bgp] router-id 3.3.3.3
    [*Switch ModuleC-bgp] peer 9:3::1 as-number 65009
    [*Switch ModuleC-bgp] peer 9:2::2 as-number 65009
    [*Switch ModuleC-bgp] ipv6-family unicast
    [*Switch ModuleC-bgp-af-ipv6] peer 9:3::1 enable
    [*Switch ModuleC-bgp-af-ipv6] peer 9:2::2 enable
    [*Switch ModuleC-bgp-af-ipv6] network 9:3:: 64
    [*Switch ModuleC-bgp-af-ipv6] network 9:2:: 64
    [*Switch ModuleC-bgp-af-ipv6] quit
    [*Switch ModuleC-bgp] quit
    [*Switch ModuleC] commit

    # Configure Switch ModuleD.

    [~Switch ModuleD] bgp 65009
    [*Switch ModuleD-bgp] router-id 4.4.4.4
    [*Switch ModuleD-bgp] peer 9:1::1 as-number 65009
    [*Switch ModuleD-bgp] peer 9:2::1 as-number 65009
    [*Switch ModuleD-bgp] ipv6-family unicast
    [*Switch ModuleD-bgp-af-ipv6] peer 9:1::1 enable
    [*Switch ModuleD-bgp-af-ipv6] peer 9:2::1 enable
    [*Switch ModuleD-bgp-af-ipv6] network 9:2:: 64
    [*Switch ModuleD-bgp-af-ipv6] network 9:1:: 64
    [*Switch ModuleD-bgp-af-ipv6] quit
    [*Switch ModuleD-bgp] quit
    [*Switch ModuleD] commit

  4. Configure the EBGP connection.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 65008
    [*Switch ModuleA-bgp] router-id 1.1.1.1
    [*Switch ModuleA-bgp] peer 10::1 as-number 65009
    [*Switch ModuleA-bgp] ipv6-family unicast
    [*Switch ModuleA-bgp-af-ipv6] peer 10::1 enable
    [*Switch ModuleA-bgp-af-ipv6] network 10:: 64
    [*Switch ModuleA-bgp-af-ipv6] network 8:: 64
    [*Switch ModuleA-bgp-af-ipv6] quit
    [*Switch ModuleA-bgp] quit
    [*Switch ModuleA] commit

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 65009
    [~Switch ModuleB-bgp] peer 10::2 as-number 65008
    [*Switch ModuleB-bgp] ipv6-family unicast
    [*Switch ModuleB-bgp-af-ipv6] peer 10::2 enable
    [*Switch ModuleB-bgp-af-ipv6] network 10:: 64
    [*Switch ModuleB-bgp-af-ipv6] quit
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # View the status of the BGP4+ peers.

    [~Switch ModuleB] display bgp ipv6 peer
     BGP local router ID : 2.2.2.2
     Local AS number : 65009
     Total number of peers : 3                 Peers in established state : 3
    
      Peer            V    AS  MsgRcvd  MsgSent  OutQ  Up/Down       State PrefRcv
    
      9:1::2          4 65009        8        9     0 00:05:37 Established       2
      9:3::2          4 65009        2        2     0 00:00:09 Established       2
      10::2           4 65008        9        7     0 00:05:38 Established       2

    The preceding information shows that the BGP4+ connections between Switch ModuleB and other Switch Modulees are set up.

    # Display the routing table of Switch ModuleA.

    [~Switch ModuleA] display bgp ipv6 routing-table
     BGP Local router ID is 1.1.1.1
     Status codes: * - valid, > - best, x - best external, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
     Total Number of Routes: 6
    
     *>  Network  : 8::                                      PrefixLen : 64
         NextHop  : ::                                       LocPrf    :
         MED      : 0                                        PrefVal   : 0
         Label    :
         Path/Ogn : i
    
     *>  Network  : 9:1::                                    PrefixLen : 64
         NextHop  : 10::1                                    LocPrf    :
         MED      : 0                                        PrefVal   : 0
         Label    :
         Path/Ogn : 65009 i
    
     *>  Network  : 9:2::                                    PrefixLen : 64
         NextHop  : 10::1                                    LocPrf    :
         MED      :                                          PrefVal   : 0
         Label    :
         Path/Ogn : 65009 i
    
     *>  Network  : 9:3::                                    PrefixLen : 64
         NextHop  : 10::1                                    LocPrf    :
         MED      : 0                                        PrefVal   : 0
         Label    :
         Path/Ogn : 65009 i
    
     *>  Network  : 10::                                     PrefixLen : 64
         NextHop  : ::                                       LocPrf    :
         MED      : 0                                        PrefVal   : 0
         Label    :
         Path/Ogn : i
    
         NextHop  : 10::1                                    LocPrf    :
         MED      : 0                                        PrefVal   : 0
         Label    :
         Path/Ogn : 65009 i                                  

    The routing table shows that Switch ModuleA has learned the route from AS 65009. AS 65008 and AS 65009 can exchange their routing information.

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ipv6 enable
     ipv6 address 8::1/64
    #
    interface Vlanif20
     ipv6 enable
     ipv6 address 10::2/64
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bgp 65008
     router-id 1.1.1.1
     peer 10::1 as-number 65009
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 8:: 64
      network 10:: 64
      peer 10::1 enable
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 20 30 40
    #
    interface Vlanif20
     ipv6 enable
     ipv6 address 10::1/64
    #
    interface Vlanif30
     ipv6 enable
     ipv6 address 9:3::1/64
    #
    interface Vlanif40
     ipv6 enable
     ipv6 address 9:1::1/64
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    bgp 65009
     router-id 2.2.2.2
     peer 9:1::2 as-number 65009
     peer 9:3::2 as-number 65009
     peer 10::2 as-number 65008
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 9:1:: 64
      network 9:3:: 64
      network 10:: 64
      peer 9:1::2 enable
      peer 9:3::2 enable
      peer 10::2 enable
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 30 50
    #
    interface Vlanif30
     ipv6 enable
     ipv6 address 9:3::2/64
    #
    interface Vlanif50
     ipv6 enable
     ipv6 address 9:2::1/64
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    bgp 65009
     router-id 3.3.3.3
     peer 9:2::2 as-number 65009
     peer 9:3::1 as-number 65009
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 9:2:: 64
      network 9:3:: 64
      peer 9:2::2 enable
      peer 9:3::1 enable
    #
    return
  • Configuration file of Switch ModuleD

    #
    sysname Switch ModuleD
    #
    vlan batch 40 50
    #
    interface Vlanif40
     ipv6 enable
     ipv6 address 9:1::2/64
    #
    interface Vlanif50
     ipv6 enable
     ipv6 address 9:2::2/64
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    bgp 65009
     router-id 4.4.4.4
     peer 9:1::1 as-number 65009
     peer 9:2::1 as-number 65009
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 9:1:: 64
      network 9:2:: 64
      peer 9:1::1 enable
      peer 9:2::1 enable
    #
    return

Example for Configuring Basic MBGP Functions

Networking Requirements

As shown in Figure 7-111, the receiver receives VoD information in multicast mode. The receiver and the source reside in different ASs. Multicast routing information needs to be transmitted between ASs.

Figure 7-111 Networking diagram of configuring MBGP



Switch

Interface

VLANIF Interface

IP Address

SwitchA

10GE1/17/1

VLANIF 100

192.1.1.1/24

-

10GE1/17/2

VLANIF 101

10.10.10.1/24

-

Loopback0

-

1.1.1.1/32

SwitchB

10GE1/17/1

VLANIF 100

192.1.1.2/24

-

10GE1/17/2

VLANIF 200

194.1.1.2/24

-

10GE1/17/3

VLANIF 300

193.1.1.2/24

-

Loopback0

-

2.2.2.2/32

SwitchC

10GE1/17/1

VLANIF 400

195.1.1.1/24

-

10GE1/17/2

VLANIF 102

22.22.22.1/24

-

10GE1/17/3

VLANIF 300

193.1.1.1/24

-

Loopback0

-

3.3.3.3/32

SwitchD

10GE1/17/1

VLANIF 400

195.1.1.2/24

-

10GE1/17/2

VLANIF 200

194.1.1.1/24

-

Loopback0

-

4.4.4.4/32

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure MBGP peers for inter-AS multicast transmission.

  2. Configure the routes advertised by MBGP.

  3. Enable the multicast function on each switch.

  4. Configure basic PIM-SM functions on each switch in ASs and enable IGMP on receiver-side interfaces.

  5. Configure a BSR boundary on the interfaces that connect to two ASs.

  6. Configure MSDP peers to transmit inter-domain multicast source information.

Procedure

  1. Assign IP addresses to the interfaces on each switch and configure OSPF in ASs.

    # Configure IP addresses and masks for the interfaces on each switch according to Figure 7-111 and configure OSPF on the switches in ASs. Ensure that Switch ModuleB, Switch ModuleC, Switch ModuleD can communicate with the receiver at the network layer, learn routes to the loopback interfaces of each other, and dynamically update routes using a unicast routing protocol. Configure OSPF process 1. The configuration procedure is not mentioned here.

  2. Configure BGP, enable the MBGP protocol, and configure MBGP peers.

    # Configure BGP and the MBGP peer on Switch ModuleA.

    [~Switch ModuleA] bgp 100
    [*Switch ModuleA-bgp] peer 192.1.1.2 as-number 200
    [*Switch ModuleA-bgp] ipv4-family multicast
    [*Switch ModuleA-bgp-af-multicast] peer 192.1.1.2 enable
    [*Switch ModuleA-bgp-af-multicast] quit
    [*Switch ModuleA-bgp] quit
    [*Switch ModuleA] commit

    # Configure BGP and the MBGP peer on Switch ModuleB.

    [~Switch ModuleB] bgp 200
    [*Switch ModuleB-bgp] peer 192.1.1.1 as-number 100
    [*Switch ModuleB-bgp] peer 193.1.1.1 as-number 200
    [*Switch ModuleB-bgp] peer 194.1.1.1 as-number 200
    [*Switch ModuleB-bgp] ipv4-family multicast
    [*Switch ModuleB-bgp-af-multicast] peer 192.1.1.1 enable
    [*Switch ModuleB-bgp-af-multicast] peer 193.1.1.1 enable
    [*Switch ModuleB-bgp-af-multicast] peer 194.1.1.1 enable
    [*Switch ModuleB-bgp-af-multicast] quit
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # Configure BGP and the MBGP peer on Switch ModuleC..

    [~Switch ModuleC] bgp 200
    [*Switch ModuleC-bgp] peer 193.1.1.2 as-number 200
    [*Switch ModuleC-bgp] peer 195.1.1.2 as-number 200
    [*Switch ModuleC-bgp] ipv4-family multicast
    [*Switch ModuleC-bgp-af-multicast] peer 193.1.1.2 enable
    [*Switch ModuleC-bgp-af-multicast] peer 195.1.1.2 enable
    [*Switch ModuleC-bgp-af-multicast] quit
    [*Switch ModuleC-bgp] quit
    [*Switch ModuleC] commit

    # Configure BGP and the MBGP peer on Switch ModuleD.

    [~Switch ModuleD] bgp 200
    [*Switch ModuleD-bgp] peer 194.1.1.2 as-number 200
    [*Switch ModuleD-bgp] peer 195.1.1.1 as-number 200
    [*Switch ModuleD-bgp] ipv4-family multicast
    [*Switch ModuleD-bgp-af-multicast] peer 194.1.1.2 enable
    [*Switch ModuleD-bgp-af-multicast] peer 195.1.1.1 enable
    [*Switch ModuleD-bgp-af-multicast] quit
    [*Switch ModuleD-bgp] quit
    [*Switch ModuleD] commit

  3. Configure the routes to be advertised by MBGP.

    # Configure the routes to be advertised on Switch ModuleA.

    [~Switch ModuleA] bgp 100
    [~Switch ModuleA-bgp] import-route direct 
    [*Switch ModuleA-bgp] ipv4-family multicast
    [*Switch ModuleA-bgp-af-multicast] import-route direct
    [*Switch ModuleA-bgp-af-multicast] quit
    [*Switch ModuleA-bgp] quit
    [*Switch ModuleA] commit

    # Configure the routes to be advertised on Switch ModuleB.

    [~Switch ModuleB] bgp 200
    [~Switch ModuleB-bgp] import-route direct 
    [*Switch ModuleB-bgp] import-route ospf 1
    [*Switch ModuleB-bgp] ipv4-family multicast
    [*Switch ModuleB-bgp-af-multicast] import-route direct
    [*Switch ModuleB-bgp-af-multicast] import-route ospf 1
    [*Switch ModuleB-bgp-af-multicast] quit
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # Configure the routes to be advertised on Switch ModuleC. The configuration of Switch ModuleD is similar to the configuration of Switch ModuleC, and is not mentioned here.

    [~Switch ModuleC] bgp 200
    [~Switch ModuleC-bgp] import-route direct 
    [*Switch ModuleC-bgp] ipv4-family multicast
    [*Switch ModuleC-bgp-af-multicast] import-route direct
    [*Switch ModuleC-bgp-af-multicast] import-route ospf 1
    [*Switch ModuleC-bgp-af-multicast] quit
    [*Switch ModuleC-bgp] quit
    [*Switch ModuleC] commit

  4. Enable multicast on all switches and PIM-SM on all interfaces. Enable IGMP on the interfaces connected to the receivers (VLANIF 102 on Switch ModuleC in this example).

    # Configure Switch ModuleA.

    [~Switch ModuleA] multicast routing-enable
    [*Switch ModuleA] interface vlanif 100
    [*Switch ModuleA-Vlanif100] pim sm
    [*Switch ModuleA-Vlanif100] quit
    [*Switch ModuleA] interface vlanif 101
    [*Switch ModuleA-Vlanif101] pim sm
    [*Switch ModuleA-Vlanif101] quit
    [*Switch ModuleA] commit

    # Configure Switch ModuleB.

    [~Switch ModuleB] multicast routing-enable
    [*Switch ModuleB] interface vlanif 100
    [*Switch ModuleB-Vlanif100] pim sm
    [*Switch ModuleB-Vlanif100] quit
    [*Switch ModuleB] interface vlanif 200
    [*Switch ModuleB-Vlanif200] pim sm
    [*Switch ModuleB-Vlanif200] quit
    [*Switch ModuleB] interface vlanif 300
    [*Switch ModuleB-Vlanif300] pim sm
    [*Switch ModuleB-Vlanif300] quit
    [*Switch ModuleB] commit

    # Configure Switch ModuleC.

    [~Switch ModuleC] multicast routing-enable
    [*Switch ModuleC] interface vlanif 400
    [*Switch ModuleC-Vlanif400] pim sm
    [*Switch ModuleC-Vlanif400] quit
    [*Switch ModuleC] interface vlanif 102
    [*Switch ModuleC-Vlanif102] pim sm
    [*Switch ModuleC-Vlanif102] igmp enable
    [*Switch ModuleC-Vlanif102] quit
    [*Switch ModuleC] interface vlanif 300
    [*Switch ModuleC-Vlanif300] pim sm
    [*Switch ModuleC-Vlanif300] quit
    [*Switch ModuleC] commit

    # Configure Switch ModuleD.

    [~Switch ModuleD] multicast routing-enable
    [*Switch ModuleD] interface vlanif 400
    [*Switch ModuleD-Vlanif400] pim sm
    [*Switch ModuleD-Vlanif400] quit
    [*Switch ModuleD] interface vlanif 200
    [*Switch ModuleD-Vlanif200] pim sm
    [*Switch ModuleD-Vlanif200] quit
    [*Switch ModuleD] commit

  5. Configure the BSR and RP within each AS.

    # Configure C-BSR and C-RP on interface Loopback0 on Switch ModuleA.

    [~Switch ModuleA] interface loopback 0
    [*Switch ModuleA-LoopBack0] ip address 1.1.1.1 255.255.255.255
    [*Switch ModuleA-LoopBack0] pim sm
    [*Switch ModuleA-LoopBack0] quit
    [*Switch ModuleA] pim
    [*Switch ModuleA-pim] c-bsr loopback 0
    [*Switch ModuleA-pim] c-rp loopback 0
    [*Switch ModuleA-pim] quit
    [*Switch ModuleA] commit

    # Configure C-BSR and C-RP on interface Loopback0 on Switch ModuleB.

    [~Switch ModuleB] interface loopback 0
    [*Switch ModuleB-LoopBack0] ip address 2.2.2.2 255.255.255.255
    [*Switch ModuleB-LoopBack0] pim sm
    [*Switch ModuleB-LoopBack0] quit
    [*Switch ModuleB] pim
    [*Switch ModuleB-pim] c-bsr loopback 0
    [*Switch ModuleB-pim] c-rp loopback 0
    [*Switch ModuleB-pim] quit
    [*Switch ModuleB] commit

  6. Configure a BSR boundary on the interfaces that connect to two ASs.

    # Configure VLANIF 100 as the BSR boundary on Switch ModuleA.

    [~Switch ModuleA] interface vlanif 100
    [~Switch ModuleA-Vlanif100] pim bsr-boundary
    [*Switch ModuleA-Vlanif100] quit
    [*Switch ModuleA] commit

    # Configure VLANIF 100 as the BSR boundary on Switch ModuleB.

    [~Switch ModuleB] interface vlanif 100
    [~Switch ModuleB-Vlanif100] pim bsr-boundary
    [*Switch ModuleB-Vlanif100] quit
    [*Switch ModuleB] commit

  7. Configure MSDP peers.

    # Configure Switch ModuleA.

    [~Switch ModuleA] msdp
    [*Switch ModuleA-msdp] peer 192.1.1.2 connect-interface vlanif100
    [*Switch ModuleA-msdp] quit
    [*Switch ModuleA] commit

    # Configure Switch ModuleB.

    [~Switch ModuleB] msdp
    [*Switch ModuleB-msdp] peer 192.1.1.1 connect-interface vlanif100
    [*Switch ModuleB-msdp] quit
    [*Switch ModuleB] commit

  8. Verify the configuration.

    # Run the display bgp multicast peer command to view the MBGP peer relationship between switches. For example, information about the MBGP peer relationship on Switch ModuleA is as follows:

    [~Switch ModuleA] display bgp multicast peer
     BGP local router ID : 1.1.1.1
     Local AS number : 100
     Total number of peers : 1                 Peers in established state : 1
      Peer        V   AS   MsgRcvd  MsgSent  OutQ   Up/Down        State  PrefRcv
      192.1.1.2   4   200       82       75     0  00:30:29  Established       17

    The preceding information shows that Switch ModuleA has established MBGP peer relationship with Switch ModuleB in AS 200.

    # Run the display msdp brief command to view information about the MSDP peer relationship between switches. For example, brief information about the MSDP peer relationship on Switch ModuleB is as follows:

    [~Switch ModuleB] display msdp brief
    MSDP Peer Brief Information of VPN-Instance: public net
    ---------------------------------------------------------------------------------                                                   
      Configured      Up        Listen       Connect      Shutdown     Down
               1       1             0             0             0        0
    ---------------------------------------------------------------------------------                                                    
      Peer's Address       State     Up/Down time    AS       SA Count     Reset Count
      192.1.1.1            Up        00:07:17        100             3                0

    The preceding information shows that Switch ModuleB has established MSDP peer relationship with Switch Modulein AS 100.

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 100 to 101
    #
    multicast routing-enable
    #
    interface Vlanif100
     ip address 192.1.1.1 255.255.255.0
     pim bsr-boundary
     pim sm
    #
    interface Vlanif101
     ip address 10.10.10.1 255.255.255.0
     pim sm
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 100
    #
    interface 10GE1/17/2
     port default vlan 101
    #
    interface LoopBack0
     ip address 1.1.1.1 255.255.255.255
     pim sm
    #
    pim
     c-bsr LoopBack0
     c-rp LoopBack0
    #
    bgp 100
     peer 192.1.1.2 as-number 200
     #
     ipv4-family unicast
      import-route direct
      peer 192.1.1.2 enable
     #
     ipv4-family multicast
      peer 192.1.1.2 enable
    #
    msdp
     peer 192.1.1.2 connect-interface Vlanif100
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 100 200 300
    #
    multicast routing-enable
    #
    interface Vlanif100
     ip address 192.1.1.2 255.255.255.0
     pim bsr-boundary 
     pim sm
    #
    interface Vlanif200
     ip address 194.1.1.2 255.255.255.0
     pim sm
    #
    interface Vlanif300
     ip address 193.1.1.2 255.255.255.0
     pim sm
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 100
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 200
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 300
    #
    interface LoopBack0
     ip address 2.2.2.2 255.255.255.255
     pim sm
    #
    pim
     c-bsr LoopBack0
     c-rp LoopBack0
    #
    ospf 1
     area 0.0.0.0
      network 2.2.2.2 0.0.0.0
      network 193.1.1.0 0.0.0.255
      network 194.1.1.0 0.0.0.255
    #
    bgp 200
     peer 192.1.1.1 as-number 100
     peer 193.1.1.1 as-number 200
     peer 194.1.1.1 as-number 200
     #
     ipv4-family unicast
      import-route direct
      import-route ospf 1
      peer 192.1.1.1 enable
      peer 193.1.1.1 enable
      peer 194.1.1.1 enable
     #
     ipv4-family multicast
      import-route direct
      import-route ospf 1
      peer 192.1.1.1 enable
      peer 193.1.1.1 enable
      peer 194.1.1.1 enable
    #
    msdp
     peer 192.1.1.1 connect-interface Vlanif100
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 102 300 400
    #
    multicast routing-enable
    #
    interface Vlanif102
     ip address 22.22.22.1 255.255.255.0
     pim sm
     igmp enable
    #
    interface Vlanif300
     ip address 193.1.1.1 255.255.255.0
     pim sm
    #
    interface Vlanif400
     ip address 195.1.1.1 255.255.255.0
     pim sm
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 400
    #
    interface 10GE1/17/2
     port default vlan 102
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 300
    #
    interface LoopBack0
     ip address 3.3.3.3 255.255.255.255
     pim sm
    #
    ospf 1
     area 0.0.0.0
      network 22.22.22.0 0.0.0.255
      network 3.3.3.3 0.0.0.0
      network 193.1.1.0 0.0.0.255
      network 195.1.1.0 0.0.0.255
    #
    bgp 200
     peer 193.1.1.2 as-number 200
     peer 195.1.1.2 as-number 200
     #
      undo synchronization
      import-route ospf 1
      peer 193.1.1.2 enable
      peer 195.1.1.2 enable
     #
     ipv4-family multicast
      import-route ospf 1
      peer 193.1.1.2 enable
      peer 195.1.1.2 enable
    #
    return
  • Configuration file of Switch ModuleD

    #
    sysname Switch ModuleD
    #
    vlan batch 200 400
    #
    multicast routing-enable
    #
    interface Vlanif200
     ip address 194.1.1.1 255.255.255.0
     pim sm
    #
    interface Vlanif400
     ip address 195.1.1.2 255.255.255.0
     pim sm
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 400
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 200
    #
    interface LoopBack0
     ip address 4.4.4.4 255.255.255.255
    #
    ospf 1
     area 0.0.0.0
      network 4.4.4.4 0.0.0.0
      network 194.1.1.0 0.0.0.255
      network 195.1.1.0 0.0.0.255
    #
    bgp 200
     peer 194.1.1.2 as-number 200
     peer 195.1.1.1 as-number 200
     #
     ipv4-family unicast
      import-route ospf 1
      peer 194.1.1.2 enable
      peer 195.1.1.1 enable
     #
     ipv4-family multicast
      import-route ospf 1
      peer 194.1.1.2 enable
      peer 195.1.1.1 enable
    #
    return

Example for Configuring BGP Load Balancing and the MED Attribute

Networking Requirements

As shown in Figure 7-112, BGP is configured on all switch moduleses; Switch ModuleA resides in AS 65008; Switch ModuleB and Switch ModuleC reside in AS 65009. EBGP connections are established between Switch ModuleA and Switch ModuleB, and between Switch ModuleA and Switch ModuleC. An IBGP connection is established between Switch ModuleB and Switch ModuleC. Load balancing needs to be implemented between AS 65008 and AS 65009. After a period, traffic from AS 65008 to AS 65009 needs to first pass through Switch ModuleC.

Figure 7-112 Networking diagram of BGP route selection



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure load balancing on Switch ModuleA.
  2. Set the MED value on Switch ModuleA to enable traffic from AS 65008 to AS 65009 to first pass through Switch ModuleC.

Procedure

  1. Configure the VLAN that each interface belongs to.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 20
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 200.1.1.2 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ip address 200.1.2.2 24
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Configure BGP connections.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 65008
    [*Switch ModuleA-bgp] router-id 1.1.1.1
    [*Switch ModuleA-bgp] peer 200.1.1.1 as-number 65009
    [*Switch ModuleA-bgp] peer 200.1.2.1 as-number 65009
    [*Switch ModuleA-bgp] quit
    [*Switch ModuleA] commit

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 65009
    [*Switch ModuleB-bgp] router-id 2.2.2.2
    [*Switch ModuleB-bgp] peer 200.1.1.2 as-number 65008
    [*Switch ModuleB-bgp] peer 9.1.1.2 as-number 65009
    [*Switch ModuleB-bgp] ipv4-family unicast 
    [*Switch ModuleB-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
    [*Switch ModuleB-bgp-af-ipv4] quit
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # Configure Switch ModuleC.

    [~Switch ModuleC] bgp 65009
    [*Switch ModuleC-bgp] router-id 3.3.3.3
    [*Switch ModuleC-bgp] peer 200.1.2.2 as-number 65008
    [*Switch ModuleC-bgp] peer 9.1.1.1 as-number 65009
    [*Switch ModuleC-bgp] ipv4-family unicast
    [*Switch ModuleC-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
    [*Switch ModuleC-bgp-af-ipv4] quit
    [*Switch ModuleC-bgp] quit
    [*Switch ModuleC] commit

    # View the BGP routing table of Switch ModuleA.

    [~Switch ModuleA] display bgp routing-table
     BGP Local router ID is 1.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
     
     Total Number of Routes: 2
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     *>   9.1.1.0/24        200.1.1.1       0                     0       65009i
     *                      200.1.2.1       0                     0       65009i

    In the BGP routing table, there are two valid routes to destination 9.1.1.0/24. The route with next-hop address 200.1.1.1 is the optimal route because the router ID of Switch ModuleB is the smallest.

  4. Configure load balancing.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 65008
    [~Switch ModuleA-bgp] ipv4-family unicast 
    [~Switch ModuleA-bgp-af-ipv4] maximum load-balancing 2
    [*Switch ModuleA-bgp-af-ipv4] quit
    [*Switch ModuleA-bgp] quit
    [*Switch ModuleA] commit

    # View the BGP routing table of Switch ModuleA.

    [~Switch ModuleA] display bgp routing-table
     BGP Local router ID is 1.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
     Total Number of Routes: 2
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     *>   9.1.1.0/24         200.1.1.1       0                     0      65009i
     *>                      200.1.2.1       0                     0      65009i

    In the BGP routing table, BGP route 9.1.1.0/24 has two next hops: 200.1.1.1 and 200.1.2.1. Both of them are optimal routes.

  5. Configure the MED attribute.

    # Set the MED value for the route sent from Switch ModuleB to Switch ModuleA using a route-policy.

    [~Switch ModuleB] route-policy 10 permit node 10
    [*Switch ModuleB-route-policy] apply cost 100
    [*Switch ModuleB-route-policy] quit
    [*Switch ModuleB] bgp 65009
    [*Switch ModuleB-bgp] peer 200.1.1.2 route-policy 10 export
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # View the BGP routing table of Switch ModuleA.

    [~Switch ModuleA] display bgp routing-table
     BGP Local router ID is 1.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
     Total Number of Routes: 2
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     *>   9.1.1.0/24         200.1.2.1       0                     0      65009i
     *                       200.1.1.1       100                   0      65009i

    In the BGP routing table, the MED value of the route with next hop 200.1.1.1 (Switch ModuleB) is 100, and the MED value of the route with next hop 200.1.2.1 is 0. Therefore, the route with the smaller MED value is preferred.

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ip address 200.1.1.2 255.255.255.0
    #
    interface Vlanif20
     ip address 200.1.2.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bgp 65008
     router-id 1.1.1.1
     peer 200.1.1.1 as-number 65009
     peer 200.1.2.1 as-number 65009
     #
     ipv4-famlily unicast
      maximum load-balancing 2
      peer 200.1.1.1 enable
      peer 200.1.2.1 enable
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 10 30
    #
    interface Vlanif10
     ip address 200.1.1.1 255.255.255.0
    #
    interface Vlanif30
     ip address 9.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     pport link-type trunk
     port trunk allow-pass vlan 30
    #
    bgp 65009
     router-id 2.2.2.2
     peer 9.1.1.2 as-number 65009
     peer 200.1.1.2 as-number 65008
     #
     ipv4-family unicast
      default med 100
      network 9.1.1.0 255.255.255.0
      peer 9.1.1.2 enable
      peer 200.1.1.2 enable
      peer 200.1.1.2 route-policy 10 export
    #
    route-policy 10 permit node 10
     apply cost 100
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 20 30
    #
    interface Vlanif20
     ip address 200.1.2.1 255.255.255.0
    #
    interface Vlanif30
     ip address 9.1.1.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    bgp 65009
     router-id 3.3.3.3
     peer 9.1.1.1 as-number 65009
     peer 200.1.2.2 as-number 65008
     #
     ipv4-family unicast
      network 9.1.1.0 255.255.255.0
      peer 9.1.1.1 enable
      peer 200.1.2.2 enable
    #
    return

Example for Configuring a BGP Route Reflector

Networking Requirements

As shown in Figure 7-113, eight Switch Modulees need to form an IBGP network. Full-mesh BGP connections have been established between Switch ModuleB, Switch ModuleD, and Switch ModuleE. Users require that the IBGP network be formed without interrupting full-mesh BGP connections between Switch ModuleB, Switch ModuleD, and Switch ModuleE and require simplified device configuration and management.

Figure 7-113 Networking diagram of configuring a BGP route reflector



Switch Module

Interface

VLANIF Interface

IP Address

Switch ModuleA

10GE 1/17/1

VLANIF 10

10.1.1.2/24

Switch ModuleA

10GE 1/17/2

VLANIF 30

10.1.3.2/24

Switch ModuleA

10GE 1/17/3

VLANIF 100

9.1.1.1/24

Switch ModuleB

10GE 1/17/1

VLANIF 10

10.1.1.1/24

Switch ModuleB

10GE 1/17/2

VLANIF 20

10.1.2.1/24

Switch ModuleB

10GE 1/17/3

VLANIF 40

10.1.4.1/24

Switch ModuleB

10GE 1/17/4

VLANIF 50

10.1.5.1/24

Switch ModuleC

10GE 1/17/1

VLANIF 30

10.1.3.1/24

Switch ModuleC

10GE 1/17/2

VLANIF 20

10.1.2.2/24

Switch ModuleC

10GE 1/17/3

VLANIF 70

10.1.7.1/24

Switch ModuleC

10GE 1/17/4

VLANIF 80

10.1.8.1/24

Switch ModuleC

10GE 1/17/5

VLANIF 90

10.1.9.1/24

Switch ModuleD

10GE 1/17/1

VLANIF 40

10.1.4.2/24

Switch ModuleD

10GE 1/17/2

VLANIF 60

10.1.6.1/24

Switch ModuleE

10GE 1/17/1

VLANIF 50

10.1.5.2/24

Switch ModuleE

10GE 1/17/2

VLANIF 60

10.1.6.2/24

Switch ModuleF

10GE 1/17/1

VLANIF 70

10.1.7.2/24

Switch ModuleG

10GE 1/17/1

VLANIF 80

10.1.8.2/24

Switch ModuleH

10GE 1/17/1

VLANIF 90

10.1.9.2/24

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure Switch ModuleB as the route reflector of Cluster1 and Switch ModuleD and Switch ModuleE as the clients of Switch ModuleB. Prohibit communication between the clients to form an IBGP network without interrupting full-mesh BGP connections between Switch ModuleB, Switch ModuleD, and Switch ModuleE.

  2. Configure Switch ModuleC as the route reflector of Cluster2 and Switch ModuleF, Switch ModuleG, and Switch ModuleH as the clients of Switch ModuleC to simplify device configuration and management.

Procedure

  1. Configure the VLAN that each interface belongs to.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 30 100
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 30
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] interface 10ge 1/17/3
    [*Switch ModuleA-10GE1/17/3] port link-type trunk
    [*Switch ModuleA-10GE1/17/3] port trunk allow-pass vlan 100
    [*Switch ModuleA-10GE1/17/3] quit
    [*Switch ModuleA] commit
    

    The configurations of Switch ModuleB, Switch ModuleC, Switch ModuleD, Switch ModuleE, Switch ModuleF, Switch ModuleG, and Switch ModuleH are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 10.1.1.2 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 30
    [*Switch ModuleA-Vlanif30] ip address 10.1.3.2 24
    [*Switch ModuleA-Vlanif30] quit
    [*Switch ModuleA] interface vlanif 100
    [*Switch ModuleA-Vlanif100] ip address 9.1.1.1 24
    [*Switch ModuleA-Vlanif100] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB, Switch ModuleC, Switch ModuleD, Switch ModuleE, Switch ModuleF, Switch ModuleG, and Switch ModuleH are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Configure IBGP connections between clients, non-clients, and route reflectors.

    # Configure Switch ModuleF.

    [~Switch ModuleF] bgp 65010
    [*Switch ModuleF-bgp] router-id 6.6.6.6
    [*Switch ModuleF-bgp] peer 10.1.7.1 as-number 65010
    [*Switch ModuleF-bgp] quit
    [*Switch ModuleF] commit

    The configurations of Switch ModuleA, Switch ModuleB, Switch ModuleC, Switch ModuleD, Switch ModuleE, Switch ModuleG, and Switch ModuleH are similar to the configuration of Switch ModuleF, and are not mentioned here.

  4. Configure a route reflector on Switch ModuleB and Switch ModuleC.

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 65010
    [*Switch ModuleB–bgp] router-id 2.2.2.2
    [*Switch ModuleB–bgp] group in_rr internal
    [*Switch ModuleB–bgp] peer 10.1.4.2 group in_rr
    [*Switch ModuleB–bgp] peer 10.1.5.2 group in_rr
    [*Switch ModuleB–bgp] ipv4-family unicast
    [*Switch ModuleB–bgp-af-ipv4] peer in_rr reflect-client
    [*Switch ModuleB–bgp-af-ipv4] undo reflect between-clients
    [*Switch ModuleB–bgp-af-ipv4] reflector cluster-id 1
    [*Switch ModuleB–bgp-af-ipv4] commit
    [~Switch ModuleB–bgp-af-ipv4] quit

    # Configure Switch ModuleC.

    [~Switch ModuleC] bgp 65010
    [*Switch ModuleC-bgp] router-id 3.3.3.3
    [*Switch ModuleC-bgp] group in_rr internal
    [*Switch ModuleC-bgp] peer 10.1.7.2 group in_rr 
    [*Switch ModuleC-bgp] peer 10.1.8.2 group in_rr
    [*Switch ModuleC-bgp] peer 10.1.9.2 group in_rr
    [*Switch ModuleC-bgp] ipv4-family unicast
    [*Switch ModuleC-bgp-af-ipv4] peer in_rr reflect-client
    [*Switch ModuleC-bgp-af-ipv4] reflector cluster-id 2
    [*Switch ModuleC-bgp-af-ipv4] commit
    [~Switch ModuleC-bgp-af-ipv4] quit

    # View the BGP routing table of Switch ModuleD.

    [~Switch ModuleD] display bgp routing-table 9.1.1.0
    BGP local router ID : 4.4.4.4
     Local AS number : 65010
     Paths:   1 available, 0 best, 0 select, 0 best-external, 0 add-path
     BGP routing table entry information of 9.1.1.0/24:
     From: 10.1.4.1 (2.2.2.2)
     Route Duration: 00h00m14s
     Relay IP Nexthop: 0.0.0.0
     Relay IP Out-Interface:
     Original nexthop: 10.1.1.2
     Qos information : 0x0
     AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, internal, pre 255
     Originator:  1.1.1.1
     Cluster list: 0.0.0.1
     Not advertised to any peer yet

    In the BGP routing table, you can see that Switch ModuleD has learned from Switch ModuleB the route advertised from Switch ModuleA, and see the Originator_ID and Cluster_List attributes of the route.

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10 30 100
    #
    interface Vlanif10
     ip address 10.1.1.2 255.255.255.0
    #
    interface Vlanif30
     ip address 10.1.3.2 255.255.255.0
    #
    interface Vlanif100
     ip address 9.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 100
    #
    bgp 65010
     router-id 1.1.1.1
     peer 10.1.1.1 as-number 65010
     peer 10.1.3.1 as-number 65010
     #
     ipv4-family unicast
      network 9.1.1.0 255.255.255.0
      peer 10.1.1.1 enable
      peer 10.1.3.1 enable
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 10 20 40 50
    #
    interface Vlanif10
     ip address 10.1.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 10.1.2.1 255.255.255.0
    #
    interface Vlanif40
     ip address 10.1.4.1 255.255.255.0
    #
    interface Vlanif50
     ip address 10.1.5.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/17/4
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    bgp 65010
     router-id 2.2.2.2
     peer 10.1.1.2 as-number 65010
     peer 10.1.2.2 as-number 65010
     group in_rr internal
     peer 10.1.4.2 as-number 65010
     peer 10.1.4.2 group in_rr
     peer 10.1.5.2 as-number 65010
     peer 10.1.5.2 group in_rr
     #
     ipv4-family unicast
      undo reflect between-clients
      reflector cluster-id 1
      peer 10.1.1.2 enable
      peer 10.1.2.2 enable
      peer in_rr enable
      peer in_rr reflect-client
      peer 10.1.4.2 enable
      peer 10.1.4.2 group in_rr
      peer 10.1.5.2 enable
      peer 10.1.5.2 group in_rr  
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 20 30 70 80 90
    #
    interface Vlanif20
     ip address 10.1.2.2 255.255.255.0
    #
    interface Vlanif30
     ip address 10.1.3.1 255.255.255.0
    #
    interface Vlanif70
     ip address 10.1.7.1 255.255.255.0
    #
    interface Vlanif80
     ip address 10.1.8.1 255.255.255.0
    #
    interface Vlanif90
     ip address 10.1.9.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 70
    #
    interface 10GE1/17/4
     port link-type trunk
     port trunk allow-pass vlan 80
    #
    interface 10GE1/17/5
     port link-type trunk
     port trunk allow-pass vlan 90
    #
    bgp 65010
     router-id 3.3.3.3
     peer 10.1.2.1 as-number 65010
     peer 10.1.3.2 as-number 65010
     group in_rr internal
     peer 10.1.7.2 as-number 65010
     peer 10.1.7.2 group in_rr
     peer 10.1.8.2 as-number 65010
     peer 10.1.8.2 group in_rr
     peer 10.1.9.2 as-number 65010
     peer 10.1.9.2 group in_rr
     #
     ipv4-family unicast
      reflector cluster-id 2
      peer 10.1.2.1 enable
      peer 10.1.3.2 enable
      peer in_rr enable
      peer in_rr reflect-client
      peer 10.1.7.2 enable
      peer 10.1.7.2 group in_rr
      peer 10.1.8.2 enable
      peer 10.1.8.2 group in_rr
      peer 10.1.9.2 enable
      peer 10.1.9.2 group in_rr
    #
    return
  • Configuration file of Switch ModuleD

    #
    sysname Switch ModuleD
    #
    vlan batch 40 60
    #
    interface Vlanif40
     ip address 10.1.4.2 255.255.255.0
    #
    interface Vlanif60
     ip address 10.1.6.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 60
    #
    bgp 65010
     router-id 4.4.4.4
     peer 10.1.4.1 as-number 65010
     peer 10.1.6.2 as-number 65010
     #
     ipv4-family unicast
      peer 10.1.4.1 enable
      peer 10.1.6.2 enable
    #
    return
NOTE:

The configuration files of the other switch moduleses are similar to the configuration file of Switch ModuleD, and are not mentioned here.

Example for Configuring a BGP4+ Route Reflection

Networking Requirements

As shown in Figure 7-114, four devices belong to two ASs. You are required to perform simplified configuration to ensure that the two ASs communicate with each other.

Figure 7-114 Networking diagram for configuring the BGP4+ route reflectors

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure basic BGP4+ functions to allow BGP neighbors to communicate.

  2. Configure Switch ModuleC as a route reflector so that no IBGP connection needs to be established between Switch ModuleB and Switch ModuleD. This simplifies the configuration.

Procedure

  1. Add interfaces to VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 20
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA]interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB, Switch ModuleC, Switch ModuleD are similar to the configuration of Switch ModuleA and are not mentioned here.

  2. Enable the IPv6 forwarding capability, and assign an IPv6 address for each interface. The following is the configuration of Switch ModuleA. The configurations of other Switch Modulees are similar to the configuration of Switch ModuleA and are not mentioned here.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ipv6 enable
    [*Switch ModuleA-Vlanif10] ipv6 address 1::1/64
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ipv6 enable
    [*Switch ModuleA-Vlanif20] ipv6 address 100::1/96
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] commit

  3. Configure the basic BGP4+ functions.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 100
    [*Switch ModuleA-bgp] router-id 1.1.1.1
    [*Switch ModuleA-bgp] peer 100::2 as-number 200
    [*Switch ModuleA-bgp] ipv6-family unicast
    [*Switch ModuleA-bgp-af-ipv6] peer 100::2 enable
    [*Switch ModuleA-bgp-af-ipv6] network 1:: 64
    [*Switch ModuleA-bgp-af-ipv6] network 100:: 96
    [*Switch ModuleA-bgp-af-ipv6] quit
    [*Switch ModuleA-bgp] quit
    [*Switch ModuleA] commit

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 200
    [*Switch ModuleB-bgp] router-id 2.2.2.2
    [*Switch ModuleB-bgp] peer 100::1 as-number 100
    [*Switch ModuleB-bgp] peer 101::1 as-number 200
    [*Switch ModuleB-bgp] ipv6-family unicast
    [*Switch ModuleB-bgp-af-ipv6] peer 100::1 enable
    [*Switch ModuleB-bgp-af-ipv6] peer 101::1 enable
    [*Switch ModuleB-bgp-af-ipv6] network 100:: 96
    [*Switch ModuleB-bgp-af-ipv6] network 101:: 96
    [*Switch ModuleB-bgp-af-ipv6] quit
    [*Switch ModuleB-bgp] quit
    [*Switch ModuleB] commit

    # Configure Switch ModuleC.

    [~Switch ModuleC] bgp 200
    [*Switch ModuleC-bgp] router-id 3.3.3.3
    [*Switch ModuleC-bgp] peer 101::2 as-number 200
    [*Switch ModuleC-bgp] peer 102::2 as-number 200
    [*Switch ModuleC-bgp] ipv6-family unicast
    [*Switch ModuleC-bgp-af-ipv6] peer 101::2 enable
    [*Switch ModuleC-bgp-af-ipv6] peer 102::2 enable
    [*Switch ModuleC-bgp-af-ipv6] network 101:: 96
    [*Switch ModuleC-bgp-af-ipv6] network 102:: 96
    [*Switch ModuleC-bgp-af-ipv6] quit
    [*Switch ModuleC-bgp] quit
    [*Switch ModuleC] commit

    # Configure Switch ModuleD.

    [~Switch ModuleD] bgp 200
    [*Switch ModuleD-bgp] router-id 4.4.4.4
    [*Switch ModuleD-bgp] peer 102::1 as-number 200
    [*Switch ModuleD-bgp] ipv6-family unicast
    [*Switch ModuleD-bgp-af-ipv6] peer 102::1 enable
    [*Switch ModuleD-bgp-af-ipv6] network 102:: 96
    [*Switch ModuleD-bgp-af-ipv6] quit
    [*Switch ModuleD-bgp] quit
    [*Switch ModuleD] commit

  4. Configure the route reflector.

    # Configure Switch ModuleC as the route reflector and Switch ModuleB and Switch ModuleD as the clients.

    [~Switch ModuleC] bgp 200
    [~Switch ModuleC-bgp] ipv6-family unicast
    [~Switch ModuleC-bgp-af-ipv6] peer 101::2 reflect-client
    [*Switch ModuleC-bgp-af-ipv6] peer 102::2 reflect-client
    [*Switch ModuleC-bgp-af-ipv6] commit

    # View the routing table of Switch ModuleB.

    [~Switch ModuleB] display bgp ipv6 routing-table
     BGP Local router ID is 2.2.2.2
     Status codes: * - valid, > - best, x - best external, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
     Total Number of Routes: 6
     *>  Network  : 1::                                      PrefixLen : 64     
         NextHop  : 100::1                                   LocPrf    :          
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : 100  i
     *>  Network  : 100::                                    PrefixLen : 96     
         NextHop  : ::                                       LocPrf    :          
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : i
        
         NextHop  : 100::1                                   LocPrf    :          
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : 100  i
     *>  Network  : 101::                                    PrefixLen : 96     
         NextHop  : ::                                       LocPrf    :          
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : i
       i
         NextHop  : 101::1                                   LocPrf    : 100       
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : i
     *>i Network  : 102::                                    PrefixLen : 96     
         NextHop  : 101::1                                   LocPrf    : 100       
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : i

    # View the routing table of Switch ModuleD.

    [~Switch ModuleD] display bgp ipv6 routing-table
     BGP Local router ID is 4.4.4.4
     Status codes: * - valid, > - best, x - best external, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
     Total Number of Routes: 5
     *>i Network  : 1::                                      PrefixLen : 64     
         NextHop  : 100::1                                   LocPrf    : 100       
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : 100  i
     *>i Network  : 100::                                    PrefixLen : 96     
         NextHop  : 101::2                                   LocPrf    : 100       
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : i
     *>i Network  : 101::                                    PrefixLen : 96     
         NextHop  : 102::1                                   LocPrf    : 100       
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : i
     *>  Network  : 102::                                    PrefixLen : 96     
         NextHop  : ::                                       LocPrf    :          
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : i
       i
         NextHop  : 102::1                                   LocPrf    : 100       
         MED      : 0                                        PrefVal   : 0         
         Label    : 
         Path/Ogn : i

    The routing tables show that Switch ModuleD and Switch ModuleB have learned the routing information advertised by Switch ModuleA from Switch ModuleC.

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ipv6 enable
     ipv6 address 1::1/64
    #
    interface Vlanif20
     ipv6 enable
     ipv6 address 100::1/96
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bgp 100
     router-id 1.1.1.1
     peer 100::2 as-number 200
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 1:: 64
      network 100:: 96
      peer 100::2 enable
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 20 30
    #
    interface Vlanif20
     ipv6 enable
     ipv6 address 100::2/96
    #
    interface Vlanif30
     ipv6 enable
     ipv6 address 101::2/96
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bgp 200
     router-id 2.2.2.2
     peer 100::1 as-number 100
     peer 101::1 as-number 200
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 100:: 96
      network 101:: 96
      peer 100::1 enable
      peer 101::1 enable
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 30 40
    #
    interface Vlanif30
     ipv6 enable
     ipv6 address 101::1/96
    #
    interface Vlanif40
     ipv6 enable
     ipv6 address 102::1/96
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    bgp 200
     router-id 3.3.3.3
     peer 101::2 as-number 200
     peer 102::2 as-number 200
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 101:: 96
      network 102:: 96
      peer 101::2 enable
      peer 101::2 reflect-client
      peer 102::2 enable
      peer 102::2 reflect-client
    #
    return
  • Configuration file of Switch ModuleD

    #
    sysname Switch ModuleD
    #
    vlan batch 40
    #
    interface Vlanif40
     ipv6 enable
     ipv6 address 102::2/96
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    bgp 200
     router-id 4.4.4.4
     peer 102::1 as-number 200
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 102:: 96
      peer 102::1 enable
    #
    return

Example for Configuring a BGP Confederation

Networking Requirements

As shown in Figure 7-115, there are multiple BGP switches in AS 200. It is required that the number of IBGP connections be reduced.

Figure 7-115 Network diagram of configuring a BGP confederation



Switch Module

Interface

VLANIF Interface

IP Address

Switch ModuleA

10GE 1/17/1

VLANIF 10

10.1.1.1/24

Switch ModuleA

10GE 1/17/2

VLANIF 20

10.1.2.1/24

Switch ModuleA

10GE 1/17/3

VLANIF 30

10.1.3.1/24

Switch ModuleA

10GE 1/17/4

VLANIF 40

10.1.4.1/24

Switch ModuleA

10GE 1/17/5

VLANIF 60

200.1.1.1/24

Switch ModuleB

10GE 1/17/1

VLANIF 10

10.1.1.2/24

Switch ModuleC

10GE 1/17/1

VLANIF 20

10.1.2.2/24

Switch ModuleD

10GE 1/17/1

VLANIF 30

10.1.3.2/24

Switch ModuleD

10GE 1/17/2

VLANIF 50

10.1.5.1/24

Switch ModuleE

10GE 1/17/1

VLANIF 40

10.1.4.2/24

Switch ModuleE

10GE 1/17/2

VLANIF 50

10.1.5.2/24

Switch ModuleF

10GE 1/17/1

VLANIF 60

200.1.1.2/24

Switch ModuleF

10GE 1/17/2

VLANIF 70

9.1.1.1/24

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a BGP confederation on each switch modules in AS 200 to divide AS 200 into three sub-ASs: AS 65001, AS 65002, and AS 65003. Three switch moduleses in AS 65001 establish full-mesh IBGP connections to reduce the number of IBGP connections.

Procedure

  1. Configure the VLAN that each interface belongs to.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 20 30 40 60
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] interface 10ge 1/17/3
    [*Switch ModuleA-10GE1/17/3] port link-type trunk
    [*Switch ModuleA-10GE1/17/3] port trunk allow-pass vlan 30
    [*Switch ModuleA-10GE1/17/3] quit
    [*Switch ModuleA] interface 10ge 1/17/4
    [*Switch ModuleA-10GE1/17/4] port link-type trunk
    [*Switch ModuleA-10GE1/17/4] port trunk allow-pass vlan 40
    [*Switch ModuleA-10GE1/17/4] quit
    [*Switch ModuleA] interface 10ge 1/17/5
    [*Switch ModuleA-10GE1/17/5] port link-type trunk
    [*Switch ModuleA-10GE1/17/5] port trunk allow-pass vlan 60
    [*Switch ModuleA-10GE1/17/5] quit
    [*Switch ModuleA] commit
    

    The configurations of Switch ModuleB, Switch ModuleC, Switch ModuleD, Switch ModuleE, and Switch ModuleF are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 10.1.1.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ip address 10.1.2.1 24
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] interface vlanif 30
    [*Switch ModuleA-Vlanif30] ip address 10.1.3.1 24
    [*Switch ModuleA-Vlanif30] quit
    [*Switch ModuleA] interface vlanif 40
    [*Switch ModuleA-Vlanif40] ip address 10.1.4.1 24
    [*Switch ModuleA-Vlanif40] quit
    [*Switch ModuleA] interface vlanif 60
    [*Switch ModuleA-Vlanif60] ip address 200.1.1.1 24
    [*Switch ModuleA-Vlanif60] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB, Switch ModuleC, Switch ModuleD, Switch ModuleE, and Switch ModuleF are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Configure a BGP confederation.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 65001
    [*Switch ModuleA-bgp] router-id 1.1.1.1
    [*Switch ModuleA-bgp] confederation id 200
    [*Switch ModuleA-bgp] confederation peer-as 65002 65003
    [*Switch ModuleA-bgp] peer 10.1.1.2 as-number 65002 
    [*Switch ModuleA-bgp] peer 10.1.2.2 as-number 65003
    [*Switch ModuleA-bgp] ipv4-family unicast
    [*Switch ModuleA-bgp-af-ipv4] peer 10.1.1.2 next-hop-local
    [*Switch ModuleA-bgp-af-ipv4] peer 10.1.2.2 next-hop-local
    [*Switch ModuleA-bgp-af-ipv4] commit
    [~Switch ModuleA-bgp-af-ipv4] quit
    [~Switch ModuleA-bgp] quit

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 65002
    [*Switch ModuleB-bgp] router-id 2.2.2.2
    [*Switch ModuleB-bgp] confederation id 200
    [*Switch ModuleB-bgp] confederation peer-as 65001 65003
    [*Switch ModuleB-bgp] peer 10.1.1.1 as-number 65001
    [*Switch ModuleB-bgp] commit
    [~Switch ModuleB-bgp] quit

    # Configure Switch ModuleC.

    [~Switch ModuleC] bgp 65003
    [*Switch ModuleC-bgp] router-id 3.3.3.3
    [*Switch ModuleC-bgp] confederation id 200
    [*Switch ModuleC-bgp] confederation peer-as 65001 65002
    [*Switch ModuleC-bgp] peer 10.1.2.1 as-number 65001
    [*Switch ModuleC-bgp] commit
    [~Switch ModuleC-bgp] quit

  4. Configure IBGP connections within AS 65001.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 65001
    [~Switch ModuleA-bgp] peer 10.1.3.2 as-number 65001
    [*Switch ModuleA-bgp] peer 10.1.4.2 as-number 65001
    [*Switch ModuleA-bgp] ipv4-family unicast
    [*Switch ModuleA-bgp-af-ipv4] peer 10.1.3.2 next-hop-local
    [*Switch ModuleA-bgp-af-ipv4] peer 10.1.4.2 next-hop-local
    [*Switch ModuleA-bgp-af-ipv4] commit
    [~Switch ModuleA-bgp-af-ipv4] quit 
    [~Switch ModuleA-bgp] quit

    # Configure Switch ModuleD.

    [~Switch ModuleD] bgp 65001
    [*Switch ModuleD-bgp] router-id 4.4.4.4
    [*Switch ModuleD-bgp] peer 10.1.3.1 as-number 65001
    [*Switch ModuleD-bgp] peer 10.1.5.2 as-number 65001
    [*Switch ModuleD-bgp] commit
    [~Switch ModuleD-bgp] quit

    # Configure Switch ModuleE.

    [~Switch ModuleE] bgp 65001
    [*Switch ModuleE-bgp] router-id 5.5.5.5
    [*Switch ModuleE-bgp] peer 10.1.4.1 as-number 65001
    [*Switch ModuleE-bgp] peer 10.1.5.1 as-number 65001
    [*Switch ModuleE-bgp] commit
    [~Switch ModuleE-bgp] quit

  5. Configure EBGP connections between AS 100 and AS200.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 65001
    [*Switch ModuleA-bgp] peer 200.1.1.2 as-number 100 
    [*Switch ModuleA-bgp] commit
    [~Switch ModuleA-bgp] quit

    # Configure Switch ModuleF.

    [~Switch ModuleF] bgp 100
    [*Switch ModuleF-bgp] router-id 6.6.6.6
    [*Switch ModuleF-bgp] peer 200.1.1.1 as-number 200 
    [*Switch ModuleF-bgp] ipv4-family unicast
    [*Switch ModuleF-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
    [*Switch ModuleF-bgp-af-ipv4] commit
    [~Switch ModuleF-bgp-af-ipv4] quit
    [~Switch ModuleF-bgp] quit

  6. Verify the configuration.

    # View the BGP routing table of Switch ModuleB.

    [~Switch ModuleB] display bgp routing-table
    
    
     BGP Local router ID is 2.2.2.2
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
    
     Total Number of Routes: 1
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
    
    
     *>i  9.1.1.0/24         10.1.1.1        0          100        0      (65001) 100i
    [~Switch ModuleB] display bgp routing-table 9.1.1.0
    
    
    BGP local router ID : 2.2.2.2
     Local AS number : 65002
     Paths:   1 available, 1 best, 1 select, 0 best-external, 0 add-path
     BGP routing table entry information of 9.1.1.0/24:
     From: 10.1.1.1 (1.1.1.1)
     Route Duration: 00h12m29s
     Relay IP Nexthop: 0.0.0.0
     Relay IP Out-Interface: Vlanif10
     Original nexthop: 10.1.1.1
     Qos information : 0x0
     AS-path (65001) 100, origin igp, MED 0, localpref 100, pref-val 0, valid, external-confed, best, select, active, pre 255
     Not advertised to any peer yet
    
    

    # View the BGP routing table of Switch ModuleD.

    [~Switch ModuleD] display bgp routing-table
    
    
     BGP Local router ID is 4.4.4.4
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
    
     Total Number of Routes: 1
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
    
    
     *>i  9.1.1.0/24         10.1.3.1        0          100        0      100i
    [~Switch ModuleD] display bgp routing-table 9.1.1.0
    
    
    BGP local router ID : 4.4.4.4
     Local AS number : 65001
     Paths:   1 available, 1 best, 1 select, 0 best-external, 0 add-path
     BGP routing table entry information of 9.1.1.0/24:
     From: 10.1.3.1 (1.1.1.1)
     Route Duration: 00h23m57s
     Relay IP Nexthop: 0.0.0.0
     Relay IP Out-Interface: Vlanif10
     Original nexthop: 10.1.3.1
     Qos information : 0x0
     AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal-confed, best, select, active, pre 255
     Not advertised to any peer yet

Configuration Files
  • Configuration file of Switch ModuleA

    #
     sysname Switch ModuleA
    #
     vlan batch 10 20 30 40 60
    #
    interface Vlanif10
     ip address 10.1.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 10.1.2.1 255.255.255.0
    #
    interface Vlanif30
     ip address 10.1.3.1 255.255.255.0
    #
    interface Vlanif40
     ip address 10.1.4.1 255.255.255.0
    #
    interface Vlanif60
     ip address 200.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/17/4
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/17/5
     port link-type trunk
     port trunk allow-pass vlan 60
    #
    bgp 65001
     router-id 1.1.1.1
     confederation id 200
     confederation peer-as 65002 65003
     peer 10.1.1.2 as-number 65002
     peer 10.1.2.2 as-number 65003
     peer 10.1.3.2 as-number 65001
     peer 10.1.4.2 as-number 65001
     peer 200.1.1.2 as-number 100
     #
     ipv4-family unicast
      peer 10.1.1.2 enable
      peer 10.1.1.2 next-hop-local
      peer 10.1.2.2 enable
      peer 10.1.2.2 next-hop-local
      peer 10.1.3.2 enable
      peer 10.1.3.2 next-hop-local
      peer 10.1.4.2 enable
      peer 10.1.4.2 next-hop-local
      peer 200.1.1.2 enable
    #
    return
  • Configuration file of Switch ModuleB

    #
     sysname Switch ModuleB
    #
     vlan batch 10
    #
    interface Vlanif10
     ip address 10.1.1.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    bgp 65002
     router-id 2.2.2.2
     confederation id 200
     confederation peer-as 65001 65003
     peer 10.1.1.1 as-number 65001
     #
     ipv4-family unicast
      peer 10.1.1.1 enable
    #
    return
  • Configuration file of Switch ModuleC

    #
     sysname Switch ModuleC
    #
     vlan batch 20
    #
    interface Vlanif20
     ip address 10.1.2.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bgp 65003
     router-id 3.3.3.3
     confederation id 200
     confederation peer-as 65001 65002
     peer 10.1.2.1 as-number 65001
     #
     ipv4-family unicast
      peer 10.1.2.1 enable
    #
    return
  • Configuration file of Switch ModuleD

    #
     sysname Switch ModuleD
    #
     vlan batch 30 50
    #
    interface Vlanif30
     ip address 10.1.3.2 255.255.255.0
    #
    interface Vlanif50
     ip address 10.1.5.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    bgp 65001
     router-id 4.4.4.4
     peer 10.1.3.1 as-number 65001
     peer 10.1.5.2 as-number 65001
     #
     ipv4-family unicast
      peer 10.1.3.1 enable
      peer 10.1.5.2 enable
    #
    return
  • Configuration file of Switch ModuleE

    #
     sysname Switch ModuleE
    #
     vlan batch 40 50
    #
    interface Vlanif40
     ip address 10.1.4.2 255.255.255.0
    #
    interface Vlanif50
     ip address 10.1.5.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    bgp 65001
     router-id 5.5.5.5
     peer 10.1.4.1 as-number 65001
     peer 10.1.5.1 as-number 65001
     #
     ipv4-family unicast
      peer 10.1.4.1 enable
      peer 10.1.5.1 enable
      #
    return
  • Configuration file of Switch ModuleF

    #
     sysname Switch ModuleF
    #
     vlan batch 60 70
    #
    interface Vlanif60
     ip address 200.1.1.2 255.255.255.0
    #
    interface Vlanif70
     ip address 9.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 60
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 70
    #
    bgp 100
     router-id 6.6.6.6
     peer 200.1.1.1 as-number 200
    #
     ipv4-family unicast
      network 9.1.1.0 255.255.255.0
      peer 200.1.1.1 enable
    #          
    return

Example for Configuring the BGP Community Attribute

Networking Requirements

As shown in Figure 7-116, EBGP connections are established between Switch ModuleB and Switch ModuleA, and between Switch ModuleB and Switch ModuleC. It is required that AS 20 not advertise the routes advertised by AS 10 to AS 30.

Figure 7-116 Networking diagram of configuring the BGP Community attribute



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a route-policy on Switch ModuleA to advertise the No_Export attribute so that AS 20 does not advertise the routes advertised by AS 10 to AS 30.

Procedure

  1. Configure the VLANs to which interfaces belong and assign IP addresses to VLANIF interfaces.

    # Configure Switch ModuleC.

    <HUAWEI> system-view
    [~HUAWEI] sysname SwitchC
    [*HUAWEI] commit
    [~SwitchC] vlan 30
    [*SwitchC-vlan30] quit
    [*SwitchC] interface 10ge 1/17/3
    [*SwitchC-10GE1/17/3] port link-type trunk
    [*SwitchC-10GE1/17/3] port trunk allow-pass vlan 30
    [*SwitchC-10GE1/17/3] quit
    [*SwitchC] interface vlanif 30
    [*SwitchC-Vlanif30] ip address 200.1.3.2 255.255.255.0
    [*SwitchC-Vlanif30] quit
    [*SwitchC] commit

    The configurations of Switch ModuleA and Switch ModuleB are similar to the configuration of Switch ModuleC, and are not mentioned here.

  2. Configure EBGP connections.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 10
    [*Switch ModuleA-bgp] router-id 1.1.1.1
    [*Switch ModuleA-bgp] peer 200.1.2.2 as-number 20
    [*Switch ModuleA-bgp] ipv4-family unicast
    [*Switch ModuleA-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
    [*Switch ModuleA-bgp-af-ipv4] commit
    [~Switch ModuleA-bgp-af-ipv4] quit

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 20
    [*Switch ModuleB-bgp] router-id 2.2.2.2
    [*Switch ModuleB-bgp] peer 200.1.2.1 as-number 10
    [*Switch ModuleB-bgp] peer 200.1.3.2 as-number 30
    [*Switch ModuleB-bgp] commit
    [~Switch ModuleB-bgp] quit

    # Configure Switch ModuleC.

    [~Switch ModuleC] bgp 30
    [*Switch ModuleC-bgp] router-id 3.3.3.3 
    [*Switch ModuleC-bgp] peer 200.1.3.1 as-number 20
    [*Switch ModuleC-bgp] commit
    [~Switch ModuleC-bgp] quit

    # View the BGP routing table of Switch ModuleB.

    [~Switch ModuleB] display bgp routing-table 9.1.1.0
    
    
    BGP local router ID : 2.2.2.2
     Local AS number : 20
     Paths:   1 available, 1 best, 1 select, 0 best-external, 0 add-path
     BGP routing table entry information of 9.1.1.0/24:
     From: 200.1.2.1 (1.1.1.1)
     Route Duration: 0d00h00m37s
     Direct Out-interface: Vlanif20
     Original nexthop: 200.1.2.1
     Qos information : 0x0
     AS-path 10, origin igp, MED 0, pref-val 0, valid, external, best, select, pre 255
     Advertised to such 2 peers:
        200.1.2.1
        200.1.3.2
    

    The preceding command output shows that Switch ModuleB has advertised received route to Switch ModuleC in AS 30.

    # View the BGP routing table of Switch ModuleC.

    [~Switch ModuleC] display bgp routing-table
    
    
     BGP Local router ID is 3.3.3.3
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
    
     Total Number of Routes: 1
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
    
    
     *>   9.1.1.0/24         200.1.3.1                             0      20 10i

    The preceding command output shows that Switch ModuleC has learned route to 9.1.1.0/24 from Switch ModuleB.

  3. Configure the BGP Community attribute.

    # Configure a route-policy on Switch ModuleA to prevent Switch ModuleB from advertising the routes advertised by Switch ModuleA to AS 30.

    [~Switch ModuleA] route-policy comm_policy permit node 10
    [*Switch ModuleA-route-policy] apply community no-export
    [*Switch ModuleA-route-policy] commit
    [~Switch ModuleA-route-policy] quit

    # Apply the route-policy.

    [~Switch ModuleA] bgp 10
    [~Switch ModuleA-bgp] ipv4-family unicast
    [~Switch ModuleA-bgp-af-ipv4] peer 200.1.2.2 route-policy comm_policy export
    [*Switch ModuleA-bgp-af-ipv4] peer 200.1.2.2 advertise-community
    [*Switch ModuleA-bgp-af-ipv4] commit

    # View the BGP routing table of Switch ModuleB.

    [~Switch ModuleB] display bgp routing-table 9.1.1.0
    
    
    BGP local router ID : 2.2.2.2
     Local AS number : 20
     Paths:   1 available, 1 best, 1 select, 0 best-external, 0 add-path
     BGP routing table entry information of 9.1.1.0/24:
     From: 200.1.2.1 (1.1.1.1)
     Route Duration: 0d00h00m12s
     Direct Out-interface: Vlanif20
     Original nexthop: 200.1.2.1
     Qos information : 0x0
     Community:no-export
     AS-path 10, origin igp, MED 0, pref-val 0, valid, external, best, select, pre 255
     Not advertised to any peers yet

    In the BGP routing table of Switch ModuleB, you can view the configured Community attribute. There is no route to 9.1.1.0/24 in the BGP routing table of Switch ModuleC.

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ip address 9.1.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 200.1.2.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20 
    #
    bgp 10
     router-id 1.1.1.1
     peer 200.1.2.2 as-number 20
     #
     ipv4-family unicast
      network 9.1.1.0 255.255.255.0
      peer 200.1.2.2 enable
      peer 200.1.2.2 route-policy comm_policy export
      peer 200.1.2.2 advertise-community
    #
    route-policy comm_policy permit node 10
     apply community no-export
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 20 30
    #
    interface Vlanif20
     ip address 200.1.2.2 255.255.255.0
    #
    interface Vlanif30
     ip address 200.1.3.1 255.255.255.0
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20 
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 30 
    #
    bgp 20
     router-id 2.2.2.2
     peer 200.1.2.1 as-number 10
     peer 200.1.3.2 as-number 30
     #
     ipv4-family unicast
      peer 200.1.2.1 enable
      peer 200.1.3.2 enable
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 30
    #
    interface Vlanif30
     ip address 200.1.3.2 255.255.255.0
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 30 
    
    #
    bgp 30
     router-id 3.3.3.3
     peer 200.1.3.1 as-number 20
     #
     ipv4-family unicast
      peer 200.1.3.1 enable
    #
    return

Example for Configuring Prefix-based BGP ORF

Networking Requirements

As shown in Figure 7-117, PE1 and PE2 belong to AS 100. PE2 needs to advertise only the routes that match the import policy of PE1 without having to maintain export policies.

Figure 7-117 Networking diagram of configuring prefix-based BGP ORF



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure prefix-based BGP ORF so that PE2 can advertise only the routes that match the import policy of PE1 without having to maintain export policies.

Procedure

  1. Configure the VLANs to which interfaces belong and assign IP addresses to VLANIF interfaces.

    # Configure PE1.

    <HUAWEI> system-view
    [~HUAWEI] sysname PE1
    [*HUAWEI] commit
    [~PE1] vlan 10
    [*PE1-vlan10] quit
    [*PE1] interface 10ge 1/17/1
    [*PE1-10GE1/17/1] port link-type trunk
    [*PE1-10GE1/17/1] port trunk allow-pass vlan 10
    [*PE1-10GE1/17/1] quit
    [*PE1] interface vlanif 10
    [*PE1-Vlanif10] ip address 111.1.1.1 255.255.255.0
    [*PE1-Vlanif10] quit
    [*PE1] commit

    The configuration of PE2 is similar to that of PE1 and is not mentioned here.

  2. Configure IPv4 unicast neighbors.

    # Configure PE1.

    [~PE1] bgp 100
    [*PE1-bgp] peer 111.1.1.2 as-number 100
    [*PE1-bgp] commit
    [~PE1-bgp] quit

    The configuration of PE2 is similar to that of PE1 and is not mentioned here.

  3. Apply the prefix-based import policy on PE1.

    # Configure PE1.

    [~PE1] ip ip-prefix 1 permit 4.4.4.0 24 greater-equal 32
    [*PE1] bgp 100
    [*PE1-bgp] peer 111.1.1.2 ip-prefix 1 import
    [*PE1-bgp] commit
    [~PE1-bgp] quit

    # Configure PE2.

    [~PE2] ip route-static 3.3.3.3 255.255.255.255 NULL0
    [*PE2] ip route-static 4.4.4.4 255.255.255.255 NULL0
    [*PE2] ip route-static 5.5.5.5 255.255.255.255 NULL0
    [*PE2] bgp 100
    [*PE2-bgp] import-route static
    [*PE2-bgp] commit
    [~PE2-bgp] quit

    # View the routes sent by PE2.

    [~PE2] display bgp routing-table peer 111.1.1.1 advertised-routes
     BGP Local router ID is 111.1.1.2
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
    Total Number of Routes: 3
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
    
     *>   3.3.3.3/32         0.0.0.0         0                     0      ?
     *>   4.4.4.4/32         0.0.0.0         0                     0      ?
     *>   5.5.5.5/32         0.0.0.0         0                     0      ?

    # View the routes received on PE1.

    [~PE1] display bgp routing-table peer 111.1.1.2 received-routes
     BGP Local router ID is 111.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
     Total Number of Routes: 1
         Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
    
     *>i  4.4.4.4/32         111.1.1.2       0          100        0      ?

    When prefix-based BGP ORF is not enabled, PE2 sends three routes 3.3.3.3, 4.4.4.4, and 5.5.5.5, but PE1 accepts only one route 4.4.4.4 because PE1 applies the prefix-based import policy to the three routes.

  4. Enable prefix-based BGP ORF.

    # Configure PE1.

    [~PE1] bgp 100
    [~PE1-bgp] peer 111.1.1.2 capability-advertise orf ip-prefix both
    [*PE1-bgp] commit
    [~PE1-bgp] quit

    # Configure PE2.

    [~PE2] bgp 100
    [~PE2-bgp] peer 111.1.1.1 capability-advertise orf ip-prefix both
    [*PE2-bgp] commit
    [~PE2-bgp] quit

  5. Verify the configuration.

    # View prefix-based BGP ORF negotiation information.

    <PE1> display bgp peer 111.1.1.2 verbose
    
            BGP Peer is 111.1.1.2,  remote AS 100
            Type: IBGP link
            BGP version 4, Remote router ID 111.1.1.2
            Update-group ID: 2
            BGP current state: Established, Up for 00h01m22s
            BGP current event: KATimerExpired
            BGP last state: OpenConfirm
            BGP Peer Up count: 8
            Received total routes: 1
            Received active routes total: 1
            Advertised total routes: 0
            Port:  Local - 54845    Remote - 179
            Configured: Connect-retry Time: 32 sec
            Configured: Active Hold Time: 180 sec   Keepalive Time:60 sec
            Received  : Active Hold Time: 180 sec
            Negotiated: Active Hold Time: 180 sec   Keepalive Time:60 sec
            Peer optional capabilities:
            Peer supports bgp multi-protocol extension
            Peer supports bgp route refresh capability
            Peer supports bgp outbound route filter capability
            Support Address-Prefix: IPv4-UNC address-family, rfc-compatible, both
            Peer supports bgp 4-byte-as capability
            Address family IPv4 Unicast: advertised and received
     Received: Total 5 messages
                     Update messages                1
                     Open messages                  1
                     KeepAlive messages             2
                     Notification messages          0
                     Refresh messages               1
     Sent: Total 4 messages
                     Update messages                0
                     Open messages                  1
                     KeepAlive messages             2
                     Notification messages          0
                     Refresh messages               1
     Authentication type configured: None
     Last keepalive received: 2013-09-21 18:54:57+00:00                             
     Last keepalive sent:2013-09-21 18:54:57                                        
     Last update received:2013-09-21 18:54:57                                       
     Last update sent:2013-09-21 18:54:57                                           
     Last refresh received:2013-09-21 18:54:57                                      
     Last refresh sended:2013-09-21 18:54:57 
     Minimum route advertisement interval is 15 seconds
     Optional capabilities:
     Route refresh capability has been enabled
     Outbound route filter capability has been enabled
     Enable Address-Prefix: IPv4-UNC address-family, rfc-compatible, both
     4-byte-as capability has been enabled
     Peer Preferred Value: 0
     Routing policy configured:
     No import update filter list
     No export update filter list
     Import prefix list is: 1
     No export prefix list
     No import route policy
     No export route policy
     No import distribute policy
     No export distribute policy
    

    # View the routes sent by PE2.

    <PE2> display bgp routing-table peer 111.1.1.1 advertised-routes
    
     BGP Local router ID is 111.1.1.2
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
     Total Number of Routes: 1
         Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
    
     *>   4.4.4.4/32         0.0.0.0         0                     0      ?
    

    # # View the routes accepted by PE1.

    <PE1> display bgp routing-table peer 111.1.1.2 received-routes
    
     BGP Local router ID is 111.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
     Total Number of Routes: 1
         Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
    
     *>i  4.4.4.4/32         111.1.1.2       0          100        0      ?
    

    After prefix-based BGP ORF is enabled, PE2 sends only one route 4.4.4.4 based on the prefix-based import policy provided by PE1.

Configuration Files
  • Configuration file of PE1

    #
    sysname PE1
    #
    vlan batch 10
    #
    interface Vlanif10
     ip address 111.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    bgp 100
     peer 111.1.1.2 as-number 100
     #
     ipv4-family unicast
      peer 111.1.1.2 enable
      peer 111.1.1.2 ip-prefix 1 import
      peer 111.1.1.2 capability-advertise orf ip-prefix both
    #
    ip ip-prefix 1 index 10 permit 4.4.4.0 24 greater-equal 32 less-equal 32
    #
    return
    
  • Configuration file of PE2

    #
    sysname PE2
    #
    vlan batch 10
    #
    interface Vlanif10
     ip address 111.1.1.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    bgp 100
     peer 111.1.1.1 as-number 100
     #
     ipv4-family unicast
      import-route static
      peer 111.1.1.1 enable
      peer 111.1.1.1 capability-advertise orf ip-prefix both
    #
    ip route-static 3.3.3.3 255.255.255.255 NULL0
    ip route-static 4.4.4.4 255.255.255.255 NULL0
    ip route-static 5.5.5.5 255.255.255.255 NULL0
    #
    return

Example for Configuring BGP Route Dampening

Networking Requirements

As shown in Figure 7-118, BGP is configured on all Switch Modulees. Switch ModuleA resides in AS 100, Switch ModuleB resides in AS 200. Switch ModuleC resides in AS 300. EBGP runs between Switch ModuleC and Switch ModuleA, between Switch ModuleC and Switch ModuleB. Switch ModuleC must apply different route dampening policies to routes of different EBGP peers to suppress unstable routes and improve network stability.

Figure 7-118 Networking diagram of configuring BGP route dampening



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a route dampening policy on Switch ModuleC.

  2. Apply the route dampening policy to flapping routes on Switch ModuleC to suppress unstable routes and improve network stability.

Procedure

  1. Configure the VLAN that each interface belongs to.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 30
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 30
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit
    

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 200.1.1.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 30
    [*Switch ModuleA-Vlanif30] ip address 8.1.1.1 8
    [*Switch ModuleA-Vlanif30] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Configure BGP connections.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 100
    [*Switch ModuleA-bgp] router-id 1.1.1.1
    [*Switch ModuleA-bgp] peer 200.1.1.2 as-number 300
    [*Switch ModuleA-bgp] ipv4-family unicast
    [*Switch ModuleA-bgp-af-ipv4] network 8.0.0.0 255.0.0.0
    [*Switch ModuleA-bgp-af-ipv4] commit
    [~Switch ModuleA-bgp-af-ipv4] quit
    [~Switch ModuleA-bgp] quit

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 200
    [*Switch ModuleB-bgp] router-id 2.2.2.2
    [*Switch ModuleB-bgp] peer 200.1.2.2 as-number 300
    [*Switch ModuleB-bgp] ipv4-family unicast
    [*Switch ModuleB-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
    [*Switch ModuleB-bgp-af-ipv4] commit
    [~Switch ModuleB-bgp-af-ipv4] quit
    [~Switch ModuleB-bgp] quit

    # Configure Switch ModuleC.

    [~Switch ModuleC] bgp 300
    [*Switch ModuleC-bgp] router-id 3.3.3.3
    [*Switch ModuleC-bgp] peer 200.1.1.1 as-number 100
    [*Switch ModuleC-bgp] peer 200.1.2.1 as-number 200
    [*Switch ModuleC-bgp] commit
    [~Switch ModuleC-bgp] quit

    # View the BGP peers of Switch ModuleC.

    [~Switch ModuleC] display bgp peer
    
     BGP local router ID : 3.3.3.3
     Local AS number : 300
     Total number of peers : 3         Peers in established state : 3
    
      Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State  PrefRcv
      200.1.1.1       4         100        3        3     0 00:00:01 Established    0
      200.1.2.1       4         200        3        3     0 00:00:00 Established    0

    The preceding command output shows that the status of BGP connections of Switch ModuleC is Established.

  4. Configure a BGP route dampening policy.

    # Configure an IP prefix list prefix-a on Switch ModuleC to allow routes with prefix 8.0.0.0/8 to pass through.

    [~Switch ModuleC] ip ip-prefix prefix-a index 10 permit 8.0.0.0 8
    [*Switch ModuleC] commit

    # Configure an IP prefix list prefix-b on Switch ModuleC to allow routes with prefix 9.1.1.0/24 to pass through.

    [~Switch ModuleC] ip ip-prefix prefix-b index 20 permit 9.1.1.0 24
    [*Switch ModuleC] commit

    # Configure a route-policy dampen-policy on Switch ModuleC to apply different route dampening policies to routes with different prefixes.

    [~Switch ModuleC] route-policy dampen-policy permit node 10
    [*Switch ModuleC-route-policy] if-match ip-prefix prefix-a
    [*Switch ModuleC-route-policy] apply dampening 10 1000 2000 5000
    [*Switch ModuleC-route-policy] commit
    [~Switch ModuleC-route-policy] quit
    [~Switch ModuleC] route-policy dampen-policy permit node 20
    [*Switch ModuleC-route-policy] if-match ip-prefix prefix-b
    [*Switch ModuleC-route-policy] apply dampening 10 800 3000 10000
    [*Switch ModuleC-route-policy] commit
    [~Switch ModuleC-route-policy] quit

    # Apply the route dampening policy to flapping routes.

    [~Switch ModuleC] bgp 300
    [~Switch ModuleC-bgp] ipv4-family unicast
    [~Switch ModuleC-bgp-af-ipv4] dampening route-policy dampen-policy
    [*Switch ModuleC-bgp-af-ipv4] commit
    [~Switch ModuleC-bgp] quit

    # View the configured BGP route dampening parameters on Switch ModuleC.

    [~Switch ModuleC] display bgp routing-table dampening parameter
    
     Maximum Suppress Time(in second) : 3973
     Ceiling Value                    : 16000
     Reuse Value                      : 750
     HalfLife Time(in  second)        : 900
     Suppress-Limit                   : 2000
     Route-policy                     : dampen-policy

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
     vlan batch 10 30
    #
    interface Vlanif10
     ip address 200.1.1.1 255.255.255.0
    #
    interface Vlanif30
     ip address 8.1.1.1 255.0.0.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 30 
    #
    bgp 100
     router-id 1.1.1.1
     peer 200.1.1.2 as-number 300
     #
     ipv4-family unicast
      network 8.0.0.0 255.0.0.0
      peer 200.1.1.2 enable
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
     vlan batch 20 40
    #
    interface Vlanif20
     ip address 200.1.2.1 255.255.255.0
    #
    interface Vlanif40
     ip address 9.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40 
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bgp 200
     router-id 2.2.2.2
     peer 200.1.2.2 as-number 300
     #
     ipv4-family unicast
      network 9.1.1.0 255.255.255.0
      peer 200.1.2.2 enable
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
     vlan batch 10 20
    #
    interface Vlanif10
     ip address 200.1.1.2 255.255.255.0
    #
    interface Vlanif20
     ip address 200.1.2.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bgp 300
     router-id 3.3.3.3
     peer 200.1.1.1 as-number 100
     peer 200.1.2.1 as-number 200
     #
     ipv4-family unicast
      dampening route-policy dampen-policy
      peer 200.1.1.1 enable
      peer 200.1.2.1 enable
    #
    route-policy dampen-policy permit node 10
     if-match ip-prefix prefix-a
     apply dampening 10 1000 2000 5000
    #
    route-policy dampen-policy permit node 20
     if-match ip-prefix prefix-b
     apply dampening 10 800 3000 10000
    #
    ip ip-prefix prefix-a index 10 permit 8.0.0.0 8
    ip ip-prefix prefix-b index 20 permit 9.1.1.0 24
    #
    return

Example for Associating BGP with BFD

Networking Requirements

As shown in Figure 7-119, Switch ModuleA belongs to AS 100, Switch ModuleB and Switch ModuleC belong to AS 200. EBGP connections are established between Switch ModuleA and Switch ModuleB, and between Switch ModuleA and Switch ModuleC.

Service traffic is transmitted along the primary link Switch ModuleA→Switch ModuleB. The link Switch ModuleA→Switch ModuleC→Switch ModuleB functions as the backup link.

Use BFD to monitor the BGP peer relationship between Switch ModuleA and Switch ModuleB. When a fault occurs on the link between Switch ModuleA and Switch ModuleB, BFD can rapidly detect the fault and notify BGP. Then traffic is transmitted on the standby link.

Figure 7-119 Networking diagram of associating BGP with BFD



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure basic BGP functions on each switch modules.

  2. Configure the MED attribute to control route selection.

  3. Enable BFD on Switch ModuleA and Switch Module.

Procedure

  1. Configure the VLAN to which each interface belongs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 20
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 200.1.2.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ip address 200.1.1.1 24
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Configure basic BGP functions, establish EBGP connections between Switch ModuleA and Switch ModuleB, and between Switch ModuleA and Switch ModuleC, and establish an IBGP connection between Switch ModuleB and Switch ModuleC.

    # Configure Switch ModuleA.

    [~Switch ModuleA] bgp 100
    [*Switch ModuleA-bgp] router-id 1.1.1.1
    [*Switch ModuleA-bgp] peer 200.1.1.2 as-number 200
    [*Switch ModuleA-bgp] peer 200.1.2.2 as-number 200
    [*Switch ModuleA-bgp] commit
    [~Switch ModuleA-bgp] quit

    # Configure Switch ModuleB.

    [~Switch ModuleB] bgp 200
    [*Switch ModuleB-bgp] router-id 2.2.2.2
    [*Switch ModuleB-bgp] peer 200.1.1.1 as-number 100
    [*Switch ModuleB-bgp] peer 9.1.1.2 as-number 200
    [*Switch ModuleB-bgp] import-route direct
    [*Switch ModuleB-bgp] commit
    [~Switch ModuleB-bgp] quit

    # Configure Switch ModuleC.

    [~Switch ModuleC] bgp 200
    [*Switch ModuleC-bgp] router-id 3.3.3.3
    [*Switch ModuleC-bgp] peer 200.1.2.1 as-number 100
    [*Switch ModuleC-bgp] peer 9.1.1.1 as-number 200
    [*Switch ModuleC-bgp] commit
    [~Switch ModuleC-bgp] quit

    # View the BGP peer status on Switch ModuleA, finding that BGP peers have been established.

    <Switch ModuleA> display bgp peer
    
    
     BGP local router ID : 1.1.1.1
     Local AS number : 100
     Total number of peers : 2                 Peers in established state : 2
    
    
      Peer            V    AS  MsgRcvd  MsgSent  OutQ  Up/Down       State PrefRcv
    
    
      200.1.1.2       4   200        2        5     0 00:01:25 Established       0
      200.1.2.2       4   200        2        4     0 00:00:55 Established       0

  4. Configure the MED attribute.

    # Set the MED values for the routes sent from Switch ModuleB and Switch ModuleC to Switch ModuleA using a route-policy.

    # Configure Switch ModuleB.

    [~Switch ModuleB] route-policy 10 permit node 10
    [*Switch ModuleB-route-policy] apply cost 100
    [*Switch ModuleB-route-policy] commit
    [~Switch ModuleB-route-policy] quit
    [~Switch ModuleB] bgp 200
    [~Switch ModuleB-bgp] peer 200.1.1.1 route-policy 10 export
    [*Switch ModuleB-bgp] commit

    # Configure Switch ModuleC.

    [~Switch ModuleC] route-policy 10 permit node 10
    [*Switch ModuleC-route-policy] apply cost 150
    [*Switch ModuleC-route-policy] commit
    [~Switch ModuleC-route-policy] quit
    [~Switch ModuleC] bgp 200
    [~Switch ModuleC-bgp] peer 200.1.2.1 route-policy 10 export
    [*Switch ModuleC-bgp] commit

    # View all BGP routing information on Switch ModuleA.

    <Switch ModuleA> display bgp routing-table
    
    
    
    
     BGP Local router ID is 1.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
    
     Total Number of Routes: 5
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
    
    
     *>  9.1.1.0/24         200.1.2.2       150                   0      200?
     *>  172.16.1.0/24      200.1.1.2       100                   0      200i
     *                      200.1.2.2       150                   0      200i
     *>   200.1.2.0         200.1.1.2       100                   0      200?
                            200.1.2.2       150                   0      200?

    In the BGP routing table, you can view that the next-hop address of the route to 172.16.1.0/24 is 200.1.1.2, and traffic is transmitted on the primary link Switch ModuleA→Switch ModuleB.

  5. Configure BFD, and set the interval for sending BFD packets, the interval for receiving BFD packets, and the local detection multiplier.

    # Enable BFD on Switch ModuleA, and set the minimum intervals for sending and receiving BFD packets to 100 ms and the local detection multiplier to 4.

    [~Switch ModuleA] bfd
    [*Switch ModuleA-bfd] quit
    [*Switch ModuleA] bgp 100
    [*Switch ModuleA-bgp] peer 200.1.1.2 bfd enable
    [*Switch ModuleA-bgp] peer 200.1.1.2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
    [*Switch ModuleA-bgp] commit

    # Enable BFD on Switch ModuleB, and set the minimum intervals for sending and receiving BFD packets to 100 ms and the local detection multiplier to 4.

    [~Switch ModuleB] bfd
    [*Switch ModuleB-bfd] quit
    [*Switch ModuleB] bgp 200
    [*Switch ModuleB-bgp] peer 200.1.1.1 bfd enable
    [*Switch ModuleB-bgp] peer 200.1.1.1 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
    [*Switch ModuleB-bgp] commit

    # View all the BFD sessions set up by BGP on Switch ModuleA.

    <Switch ModuleA> display bgp bfd session all
    --------------------------------------------------------------------------------
      Local_Address      Peer_Address       Interface
      200.1.1.1          200.1.1.2          Vlanif20
      Tx-interval(ms)    Rx-interval(ms)    Multiplier  Session-State
      100                100                4           Up
    --------------------------------------------------------------------------------

  6. Verify the configuration.

    # Run the shutdown command on GE1/17/2 of Switch ModuleB to simulate a primary link fault.

    [~Switch ModuleB] interface 10ge 1/17/2
    [~Switch ModuleB-10GE1/17/2] shutdown
    [*Switch ModuleB-10GE1/17/2] commit

    # View the BGP routing table of Switch ModuleA.

    <Switch ModuleA> display bgp routing-table
    
    
     BGP Local router ID is 1.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
    
    
     Total Number of Routes: 3
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
    
    
     *>  9.1.1.0/24          200.1.2.2      150                   0      200?
     *>  172.16.1.0/24       200.1.2.2      150                   0      200i
         200.1.2.0           200.1.2.2      150                   0      200?

    In the BGP routing table, you can view that the backup link Switch ModuleA→Switch ModuleC→Switch ModuleB takes effect after the primary link fails, and the next-hop address of the route to 172.16.1.0/24 becomes 200.1.2.2.

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    router id 1.1.1.1
    #
    vlan batch 10 20
    #
      bfd
    #
    interface Vlanif10
     ip address 200.1.2.1 255.255.255.0
    #
    interface Vlanif20
     ip address 200.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bgp 100
     router-id 1.1.1.1
     peer 200.1.1.2 as-number 200
     peer 200.1.1.2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
     peer 200.1.1.2 bfd enable
     peer 200.1.2.2 as-number 200
     #
     ipv4-family unicast
      peer 200.1.1.2 enable
      peer 200.1.2.2 enable
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    router id 2.2.2.2
    #
    vlan batch 20 30 40
    #
     bfd
    #
    interface Vlanif20
     ip address 200.1.1.2 255.255.255.0
    #
    interface Vlanif30
     ip address 9.1.1.1 255.255.255.0
    #
    interface Vlanif40
     ip address 172.16.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/3
     port hybrid pvid vlan 40
     port trunk allow-pass vlan 40
    #
    bgp 200
     router-id 2.2.2.2
     peer 9.1.1.2 as-number 200
     peer 200.1.1.1 as-number 100
     peer 200.1.1.1 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
     peer 200.1.1.1 bfd enable
     #
     ipv4-family unicast
      import-route direct
      peer 9.1.1.2 enable
      peer 200.1.1.1 enable
      peer 200.1.1.1 route-policy 10 export
    #
    route-policy 10 permit node 10
     apply cost 100
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    router id 3.3.3.3
    #
    vlan batch 10 30
    #
     bfd
    #
    interface Vlanif10
     ip address 200.1.2.2 255.255.255.0
    #
    interface Vlanif30
     ip address 9.1.1.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    bgp 200
     router-id 3.3.3.3
     peer 9.1.1.1 as-number 200
     peer 200.1.2.1 as-number 100
     #
     ipv4-family unicast
      network 9.1.1.0 255.255.255.0
      peer 9.1.1.1 enable
      peer 200.1.2.1 enable
      peer 200.1.2.1 route-policy 10 export
    #
    route-policy 10 permit node 10
     apply cost 150
    #
    return

Example for Configuring BFD for BGP4+

Networking Requirements

As shown in Figure 7-120, SwitchA belongs to AS 100. SwitchB and SwitchC belong to AS 200. SwitchA establishes EBGP connections with both SwitchB and SwitchC.

Service traffic is forwarded along the primary link SwitchA→SwitchB. The link SwitchA→SwitchC→SwitchB is used as a backup. Customers require that a fault on the primary link be detected in milliseconds so that service traffic can be fast switched to the backup link when the primary link fails.

Figure 7-120 Networking diagram for configuring BFD for BGP4+

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure basic BGP4+ functions on all switches so that they can establish BGP peer relationships with each other.

  2. Configure MED-based route selection on SwitchA and SwitchB to forward traffic on the primary link between SwitchA and SwitchB.

  3. Enable BFD on SwitchA and SwitchB to detect faults in milliseconds so that service traffic can be fast switched to the backup link when the primary link fails.

Procedure

  1. Configure IPv6 addresses for interfaces of all switches. The configuration details are not provided here.
  2. Configure basic BGP4+ functions, establish EBGP connections between SwitchA and SwitchB and between SwitchA and SwitchC, and establish an IBGP connection between SwitchB and SwitchC.

    # Configure SwitchA.

    [~SwitchA] bgp 100
    [*SwitchA-bgp] router-id 1.1.1.1
    [*SwitchA-bgp] peer 8::2 as-number 200
    [*SwitchA-bgp] peer 10::2 as-number 200
    [*SwitchA-bgp] ipv6-family unicast
    [*SwitchA-bgp-af-ipv6] peer 8::2 enable
    [*SwitchA-bgp-af-ipv6] peer 10::2 enable
    [*SwitchA-bgp-af-ipv6] commit
    [~SwitchA-bgp-af-ipv6] quit
    [~SwitchA-bgp] quit

    # Configure SwitchB.

    [~SwitchB] bgp 200
    [*SwitchB-bgp] router-id 2.2.2.2
    [*SwitchB-bgp] peer 8::1 as-number 100
    [*SwitchB-bgp] peer 9::1:2 as-number 200
    [*SwitchB-bgp] ipv6-family unicast
    [*SwitchB-bgp-af-ipv6] peer 8::1 enable
    [*SwitchB-bgp-af-ipv6] peer 9::1:2 enable
    [*SwitchB-bgp-af-ipv6] network 7:: 64
    [*SwitchB-bgp-af-ipv6] commit
    [~SwitchB-bgp-af-ipv6] quit
    [~SwitchB-bgp] quit

    # Configure SwitchC.

    [~SwitchC] bgp 200
    [*SwitchC-bgp] router-id 3.3.3.3
    [*SwitchC-bgp] peer 10::1 as-number 100
    [*SwitchC-bgp] peer 9::1:1 as-number 200
    [*SwitchC-bgp] ipv6-family unicast
    [*SwitchC-bgp-af-ipv6] peer 10::1 enable
    [*SwitchC-bgp-af-ipv6] peer 9::1:1 enable
    [*SwitchC-bgp-af-ipv6] commit
    [~SwitchC-bgp-af-ipv6] quit
    [~SwitchC-bgp] quit

    # Run the display bgp ipv6 peer command on SwitchA. The command output shows that BGP peer relationships have been established.

    <SwitchA> display bgp ipv6 peer
     BGP local router ID : 1.1.1.1
     Local AS number : 100
     Total number of peers : 2                 Peers in established state : 2
    
      Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State PrefRcv
    
      8::2            4         200       12       11     0 00:07:26 Established   0
      10::2           4         200       12       12     0 00:07:21 Established   0

  3. Configure the MED attribute.

    Set MED values of routes sent from SwitchB and SwitchC to SwitchA through routing policies.

    # Configure SwitchB.

    [~SwitchB] route-policy 10 permit node 10
    [*SwitchB-route-policy] apply cost 100
    [*SwitchB-route-policy] quit
    [*SwitchB] bgp 200
    [*SwitchB-bgp] ipv6-family unicast
    [*SwitchB-bgp-af-ipv6] peer 8::1 route-policy 10 export
    [*SwitchB-bgp-af-ipv6] quit
    [*SwitchB-bgp] quit
    [*SwitchB] commit

    # Configure SwitchC.

    [~SwitchC] route-policy 10 permit node 10
    [*SwitchC-route-policy] apply cost 150
    [*SwitchC-route-policy] quit
    [*SwitchC] bgp 200
    [*SwitchC-bgp] ipv6-family unicast
    [*SwitchC-bgp-af-ipv6] peer 10::1 route-policy 10 export
    [*SwitchC-bgp-af-ipv6] quit
    [*SwitchC-bgp] quit
    [*SwitchC] commit

    # Check the BGP routing table on SwitchA.

    <SwitchA> display bgp ipv6 routing-table
     BGP Local router ID is 1.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
     RPKI validation codes: V - valid, I - invalid, N - not-found  
    
     Total Number of Routes: 2
     *>  Network  : 7::                                      PrefixLen : 64
         NextHop  : 8::2                                     LocPrf    :
         MED      : 100                                      PrefVal   : 0
         Label    :
         Path/Ogn : 200i
     *
         NextHop  : 10::2                                    LocPrf    :
         MED      : 150                                      PrefVal   : 0
         Label    :
         Path/Ogn : 200i

    In the BGP routing table, you can view that the next hop address of the route to 7::1/64 is 8::2, and traffic is transmitted on the primary link SwitchA→SwitchB.

  4. Configure BFD, and set the intervals at which BFD packets are sent and received and the local detection multiplier.

    # Configure BFD on SwitchA, and set the minimum intervals for sending and receiving BFD packets to both 100 ms and the local detection multiplier to 4.

    [~SwitchA] bfd
    [*SwitchA-bfd] quit
    [*SwitchA] bgp 100
    [*SwitchA-bgp] peer 8::2 bfd enable
    [*SwitchA-bgp] peer 8::2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
    [*SwitchA-bgp] quit
    [*SwitchA] commit

    # Configure BFD on SwitchB, and set the minimum intervals for sending and receiving BFD packets to both 100 ms and the local detection multiplier to 4.

    [~SwitchB] bfd
    [*SwitchB-bfd] quit
    [*SwitchB] bgp 200
    [*SwitchB-bgp] peer 8::1 bfd enable
    [*SwitchB-bgp] peer 8::1 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
    [*SwitchB-bgp] commit

    # Check all BFD sessions on SwitchA.

    <SwitchA> display bgp ipv6 bfd session all
    --------------------------------------------------------------------------------
      Local_Address  : 8::1                                    
      Peer_Address   : 8::2                                    
      Tx-interval(ms): 100         Rx-interval(ms): 100 
      Multiplier     : 4           Interface      : 10GE1/17/1
      Session-State  : Up
    --------------------------------------------------------------------------------

  5. Verify the configuration.

    # Run the shutdown command on 10GE1/17/2 of SwitchB to simulate a primary link fault.

    [~SwitchB] interface 10ge 1/17/2
    [~SwitchB-10GE1/17/2] shutdown
    [*SwitchB-10GE1/17/2] commit

    # Check the BGP routing table on SwitchA.

    <SwitchA> display bgp ipv6 routing-table
     BGP Local router ID is 1.1.1.1
     Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
                   h - history,  i - internal, s - suppressed, S - Stale
                   Origin : i - IGP, e - EGP, ? - incomplete
     RPKI validation codes: V - valid, I - invalid, N - not-found    
    
     Total Number of Routes: 1
     *>  Network  : 7::                                      PrefixLen : 64
         NextHop  : 10::2                                   LocPrf    :
         MED      : 150                                      PrefVal   : 0
         Label    :
         Path/Ogn : 200i

    In the BGP routing table, you can view that the backup link SwitchA-SwitchC-SwitchB transmits traffic after the primary link fails, and the next hop address of the route to 7::1/64 becomes 10::2.

Configuration Files
  • Configuration file of SwitchA

    #
    sysname SwitchA
    #
    bfd
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 8::1/64
    #
    interface 10GE1/17/2
     undo portswitch
     ipv6 enable
     ipv6 address 10::1/64
    #
    bgp 100
     router-id 1.1.1.1
     peer 8::2 as-number 200
     peer 8::2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
     peer 8::2 bfd enable
     peer 10::2 as-number 200
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      peer 8::2 enable
      peer 10::2 enable
    #
    return
  • Configuration file of SwitchB

    #
    sysname SwitchB
    #
    bfd
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 9::1:1/64
    #
    interface 10GE1/17/2
     undo portswitch
     ipv6 enable
     ipv6 address 8::2/64
    #
    interface 10GE1/17/3
     undo portswitch
     ipv6 enable
     ipv6 address 7::1/64
    #
    bgp 200
     router-id 2.2.2.2
     peer 8::1 as-number 100
     peer 8::1 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
     peer 8::1 bfd enable
     peer 9::1:2 as-number 200
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 7:: 64
      peer 8::1 enable
      peer 8::1 route-policy 10 export
      peer 9::1:2 enable
    #
    route-policy 10 permit node 10
     apply cost 100
    #
    return
  • Configuration file of SwitchC

    #
    sysname SwitchC
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 9::1:2/64
    #
    interface 10GE1/17/2
     undo portswitch
     ipv6 enable
     ipv6 address 10::2/64
    #
    bgp 200
     router-id 3.3.3.3
     peer 9::1:1 as-number 200
     peer 10::1 as-number 100
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      peer 9::1:1 enable
      peer 10::1 enable
      peer 10::1 route-policy 10 export
    #
    route-policy 10 permit node 10
     apply cost 150
    #
    return

Example for Configuring BGP Auto FRR

Networking Requirements

As shown in Figure 7-121, Switch ModuleA belongs to AS 100, Switch ModuleB, Switch ModuleC, and Switch ModuleD belong to AS 200 and establish IBGP connections. Routes from Switch ModuleA to Switch ModuleD must have backup forwarding information so that traffic can be fast switched to the backup link after a fault is detected. This improves network reliability.

Figure 7-121 Networking diagram of configuring BGP Auto FRR



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a route-policy on Switch ModuleB and Switch ModuleC to change the MED values of routes to Switch ModuleD to facilitate route selection.

  2. Configure BGP Auto FRR on Switch ModuleA so that traffic can be fast switched to the backup link when a fault is detected.

Procedure

  1. Configure the VLAN to which each interface belongs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 20
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB, Switch ModuleC, and Switch ModuleD are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 10.1.1.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ip address 10.2.1.1 24
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB, Switch ModuleC, and Switch ModuleD are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Establish EBGP connections between Switch ModuleA and Switch ModuleB, and between Switch ModuleA and Switch ModuleC, and establish IBGP connections between Switch ModuleD and Switch ModuleB, and between Switch ModuleD and Switch ModuleC.

    # Configure Switch ModuleA.

    <Switch ModuleA> system-view
    [~Switch ModuleA] bgp 100
    [*Switch ModuleA-bgp] router-id 1.1.1.1
    [*Switch ModuleA-bgp] peer 10.1.1.2 as-number 200
    [*Switch ModuleA-bgp] peer 10.2.1.2 as-number 200
    [*Switch ModuleA-bgp] commit
    NOTE:
    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

    # Configure Switch ModuleD.

    <Switch ModuleD> system-view
    [~Switch ModuleD] bgp 200
    [*Switch ModuleD-bgp] router-id 4.4.4.4
    [*Switch ModuleD-bgp] peer 10.3.1.1 as-number 200
    [*Switch ModuleD-bgp] peer 10.4.1.1 as-number 200
    [*Switch ModuleD-bgp] commit
    NOTE:
    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleD, and are not mentioned here.

  4. Configure a route-policy on Switch ModuleB and Switch ModuleC so that routes to Switch ModuleD have different MED values.

    # Configure a route-policy on Switch ModuleB.

    <Switch ModuleB> system-view
    [~Switch ModuleB] route-policy rtb permit node 10
    [*Switch ModuleB-route-policy] apply cost 80
    [*Switch ModuleB-route-policy] quit
    [*Switch ModuleB] bgp 200
    [*Switch ModuleB-bgp] ipv4-family unicast
    [*Switch ModuleB-bgp-af-ipv4] peer 10.1.1.1 route-policy rtb export
    [*Switch ModuleB-bgp-af-ipv4] commit
    [~Switch ModuleB-bgp-af-ipv4] quit

    # Configure a route-policy on Switch ModuleC.

    <Switch ModuleC> system-view
    [~Switch ModuleC] route-policy rtc permit node 10
    [*Switch ModuleC-route-policy] apply cost 120
    [*Switch ModuleC-route-policy] quit
    [*Switch ModuleC] bgp 200
    [*Switch ModuleC-bgp] ipv4-family unicast
    [*Switch ModuleC-bgp-af-ipv4] peer 10.2.1.1 route-policy rtc export
    [*Switch ModuleC-bgp-af-ipv4] commit
    [~Switch ModuleC-bgp-af-ipv4] quit

    # Advertise a route to 4.4.4.4/32 on Switch ModuleD.

    [~Switch ModuleD] bgp 200
    [*Switch ModuleD-bgp] ipv4-family unicast
    [*Switch ModuleD-bgp] network 4.4.4.4 32
    [*Switch ModuleD-bgp] commit

    # Run the display ip routing-table verbose command on Switch ModuleA to check detailed information about the route to 4.4.4.4/32.

    <Switch ModuleA> display ip routing-table 4.4.4.4 32 verbose
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
    Summary Count : 1
    
    Destination: 4.4.4.4/32
         Protocol: EBGP            Process ID: 0
       Preference: 255                   Cost: 80
          NextHop: 10.1.1.2         Neighbour: 10.1.1.2
            State: Active Adv             Age: 00h00m12s
              Tag: 0                 Priority: low
            Label: NULL               QoSInfo: 0x0
       IndirectID: 0x4
     RelayNextHop: 0.0.0.0          Interface: Vlanif10
         TunnelID: 0x0                  Flags:  D

    The MED value of the route learned from Switch ModuleB is smaller. Therefore, Switch ModuleA selects the path Switch ModuleA→Switch ModuleB→Switch ModuleD as the route to 4.4.4.4/32. Because FRR is not configured, no backup forwarding information is available.

  5. Enable BGP Auto FRR on Switch ModuleA, and check the routing information.

    # Enable BGP Auto FRR on Switch ModuleA.

    <Switch ModuleA> system-view
    [~Switch ModuleA] bgp 100
    [~Switch ModuleA-bgp] ipv4-family unicast
    [~Switch ModuleA-bgp-af-ipv4] auto-frr
    [*Switch ModuleA-bgp-af-ipv4] commit
    [~Switch ModuleA-bgp-af-ipv4] quit

    # After the configuration, run the display ip routing-table verbose command on Switch ModuleA to check the routing information.

    <Switch ModuleA> display ip routing-table 4.4.4.4 32 verbose
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
    Summary Count : 1
    
    Destination: 4.4.4.4/32
         Protocol: EBGP            Process ID: 0
       Preference: 255                   Cost: 80
          NextHop: 10.1.1.2         Neighbour: 10.1.1.2
            State: Active Adv             Age: 00h52m45s
              Tag: 0                 Priority: low
            Label: NULL               QoSInfo: 0x0
       IndirectID: 0x4
     RelayNextHop: 0.0.0.0          Interface: Vlanif10
         TunnelID: 0x0                  Flags:  D
        BkNextHop: 10.2.1.2       BkInterface: Vlanif20
          BkLabel: NULL           SecTunnelID: 0x0
     BkPETunnelID: 0x0        BkPESecTunnelID: 0x0
     BkIndirectID: 0x2  

    The preceding command output shows that Switch ModuleA has a backup next hop and a backup outbound interface for the route to 4.4.4.4/32.

Configuration Files
  • Configuration file of Switch ModuleA
    #
    sysname Switch ModuleA
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ip address 10.1.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 10.2.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bgp 100
     router-id 1.1.1.1
     peer 10.1.1.2 as-number 200
     peer 10.2.1.2 as-number 200
     #
     ipv4-family unicast
      peer 10.1.1.2 enable
      peer 10.2.1.2 enable
      auto-frr
    #
    return      
  • Configuration file of Switch ModuleB
    #
    sysname Switch ModuleB
    #
    vlan batch 10 30
    #
    interface Vlanif10
     ip address 10.1.1.2 255.255.255.0
    #
    interface Vlanif30
      ip address 10.3.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    bgp 200
     router-id 2.2.2.2
     peer 10.1.1.1 as-number 100
     peer 10.3.1.2 as-number 200
     #
     ipv4-family unicast 
      peer 10.1.1.1 enable
      peer 10.3.1.2 enable
      peer 10.1.1.1 route-policy rtb export
    #
    route-policy rtb permit node 10
     apply cost 80
    #
    return
    
  • Configuration file of Switch ModuleC
    #
    sysname Switch ModuleC
    #
    vlan batch 20 40
    #
    interface Vlanif20
     ip address 10.2.1.2 255.255.255.0
    #
    interface Vlanif40
     ip address 10.4.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 20 
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    bgp 200
     router-id 3.3.3.3
     peer 10.2.1.1 as-number 100
     peer 10.4.1.2 as-number 200
     #
     ipv4-family unicast
      peer 10.2.1.1 enable
      peer 10.4.1.2 enable
      peer 10.2.1.1 route-policy rtc export
    #
    route-policy rtc permit node 10
     apply cost 120
    #
    return
    
  • Configuration file of Switch ModuleD
    #
    sysname Switch ModuleD
    #
    vlan batch 30 40
    #
    interface Vlanif30
     ip address 10.3.1.2 255.255.255.0
    #
    interface Vlanif40
      ip address 10.4.1.2 255.255.255.0
    #
    interface LoopBack1
     ip address 4.4.4.4 255.255.255.255
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 30 
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    bgp 200
     router-id 4.4.4.4
     peer 10.3.1.1 as-number 200
     peer 10.4.1.1 as-number 200
     #
     ipv4-family unicast
      peer 10.3.1.1 enable
      peer 10.4.1.1 enable
      network 4.4.4.4 255.255.255.255
    #
    return   

Example for Configuring BGP4+ 6PE

Networking Requirements

BGP4+ 6PE enables isolated IPv6 networks to communicate over IPv4/MPLS networks.

As shown in Figure 7-122, there is no direct link between CE1 and CE2. However, CE1 and CE2 are both connected to the IPv4/MPLS network of AS200. CE1 and CE2 are expected to communicate through the IPv4/MPLS network. To meet this requirement, a 6PE peer relationship is set up between PE1 and PE2. 6PE enables a PE to send IPv6 routes learnt from its connected CE to its peer using MP-BGP and forward IPv6 data on the LDP LSP.

Figure 7-122 Networking diagram for configuring BGP4+ 6PE

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure OSPF between PE1 and PE2 to enable them to learn IP addresses of the peer loopback interfaces.

  2. Enable MPLS and MPLS LDP on the backbone network so that LDP LSPs can be established between the PE devices.

  3. Configure a 6PE peer relationship between PE1 and PE2.

  4. Configure BGP4+ between PE and switch devices so that they can exchange IPv6 route information.

Procedure

  1. Configure IPv4 addresses and IPv6 addresses for interfaces. The configuration procedure is not provided here.
  2. Configure OSPF between PE1 and PE2 so that they can learn the routes to the peer loopback interfaces. For details about the configuration procedure, see Configuration Files.
  3. Enable MPLS and MPLS LDP on the backbone network so that LDP LSPs can be established between the PE devices.

    # Configure PE1.

    [~PE1] mpls lsr-id 2.2.2.2
    [*PE1] mpls
    [*PE1-mpls] quit
    [*PE1] mpls ldp
    [*PE1-mpls-ldp] quit
    [*PE1] interface 10ge 1/17/2
    [*PE1-10GE1/17/2] mpls
    [*PE1-10GE1/17/2] mpls ldp
    [*PE1-10GE1/17/2] quit
    [*PE1] commit

    # Configure PE2.

    [~PE2] mpls lsr-id 3.3.3.3
    [*PE2] mpls
    [*PE2-mpls] quit
    [*PE2] mpls ldp
    [*PE2-mpls-ldp] quit
    [*PE2] interface 10ge 1/17/2
    [*PE2-10GE1/17/2] mpls
    [*PE2-10GE1/17/2] mpls ldp
    [*PE2-10GE1/17/2] quit
    [*PE2] commit

    After the configurations are complete, run the display mpls ldp session command on either PE. The command output shows that an LDP session is set up between PEs.

    [~PE1] display mpls ldp session
     LDP Session(s) in Public Network
     Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
     A '*' before a session means the session is being deleted.
    --------------------------------------------------------------------------
     PeerID             Status      LAM  SsnRole  SsnAge       KASent/Rcv
    --------------------------------------------------------------------------
     3.3.3.3:0         Operational DU   Passive  000:00:35    143/199
    --------------------------------------------------------------------------
    TOTAL: 1 Session(s) Found.

  4. Configure a 6PE peer relationship.

    # Configure PE1.

    [~PE1] bgp 200
    [*PE1-bgp] peer 3.3.3.3 as-number 200
    [*PE1-bgp] peer 3.3.3.3 connect-interface LoopBack0
    [*PE1-bgp] ipv6-family unicast
    [*PE1-bgp-af-ipv6] peer 3.3.3.3 enable
    [*PE1-bgp-af-ipv6] peer 3.3.3.3 label-route-capability
    [*PE1-bgp-af-ipv6] quit
    [*PE1-bgp] quit
    [*PE1] commit

    # Configure PE2.

    [~PE2] bgp 200
    [*PE2-bgp] peer 2.2.2.2 as-number 200
    [*PE2-bgp] peer 2.2.2.2 connect-interface LoopBack0
    [*PE2-bgp] ipv6-family unicast
    [*PE2-bgp-af-ipv6] peer 2.2.2.2 enable
    [*PE2-bgp-af-ipv6] peer 2.2.2.2 label-route-capability
    [*PE2-bgp-af-ipv6] commit
    [*PE2-bgp-af-ipv6] quit
    [*PE2-bgp] quit
    [*PE2] commit

    # After the configurations are complete, run the display bgp ipv6 peer command on either PE. The command output shows that a 6PE peer relationship is set up between PEs.

    [~PE1] display bgp ipv6 peer
    
    
     BGP local router ID : 2.2.2.2
     Local AS number : 200
     Total number of peers : 2                 Peers in established state : 2
    
    
      Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State PrefRcv
    
    
      3.3.3.3         4         200     1248     1342      0 18:06:28 Established      1

  5. Configure BGP4+ between PE and switch devices so that they can exchange IPv6 route information.

    # Configure CE1.

    [~CE1] bgp 100
    [*CE1-bgp] router-id 5.5.5.5
    [*CE1-bgp] peer 1::2 as-number 200
    [*CE1-bgp] ipv6-family unicast
    [*CE1-bgp-af-ipv6] peer 1::2 enable
    [*CE1-bgp-af-ipv6] network 5::5 128
    [*CE1-bgp-af-ipv6] commit
    [~CE1-bgp-af-ipv6] quit
    [~CE1-bgp] quit

    # Configure PE1.

    [~PE1] bgp 200
    [*PE1-bgp] peer 1::1 as-number 100
    [*PE1-bgp] ipv6-family unicast
    [*PE1-bgp-af-ipv6] peer 1::1 enable
    [*PE1-bgp-af-ipv6] commit
    [~PE1-bgp-af-ipv6] quit
    [~PE1-bgp] quit

    # Configure PE2.

    [~PE2] bgp 200
    [*PE2-bgp] peer 2::1 as-number 300
    [*PE2-bgp] ipv6-family unicast
    [*PE2-bgp-af-ipv6] peer 2::1 enable
    [*PE2-bgp-af-ipv6] commit
    [~PE2-bgp-af-ipv6] quit
    [~PE2-bgp] quit

    # Configure CE2.

    [~CE2] bgp 300
    [*CE2-bgp] router-id 6.6.6.6
    [*CE2-bgp] peer 2::2 as-number 200
    [*CE2-bgp] ipv6-family unicast
    [*CE2-bgp-af-ipv6] peer 2::2 enable
    [*CE2-bgp-af-ipv6] network 6::6 128
    [*CE2-bgp-af-ipv6] commit
    [~CE2-bgp-af-ipv6] quit
    [~CE2-bgp] quit

    After the configurations are complete, run the display bgp ipv6 peer command on a PE or switch. The command output shows that a BGP peer relationship is set up between PE and switch devices.

    # Take the display on PE1 as an example:

    [~PE1] display bgp ipv6 peer
     BGP local router ID : 2.2.2.2
     Local AS number : 100
     Total number of peers : 2         Peers in established state : 2
    
      Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State  PrefRcv
      3.3.3.3         4         200       59       60     0 00:35:46 Established        1
      1::1            4         100       40       45     0 00:06:16 Established        1

  6. Verify the configuration.

    After the preceding configurations are complete, switches can learn the routes to the peer loopback interfaces and ping each other.

    # Take CE1 as an example:

    [~CE1] display ipv6 routing-table
    Routing Table : _public_
             Destinations : 8        Routes : 8         
    
     Destination  : ::1                             PrefixLength : 128
     NextHop      : ::1                             Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : InLoopBack0                     Flags        : D
    
     Destination  : ::FFFF:127.0.0.0                PrefixLength : 104
     NextHop      : ::FFFF:127.0.0.0                Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : InLoopBack0                     Flags        : D
    
     Destination  : ::FFFF:127.0.0.0                PrefixLength : 128
     NextHop      : ::1                             Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : InLoopBack0                     Flags        : D
    
     Destination  : 1::                             PrefixLength : 64
     NextHop      : 1::1                            Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : 10GE1/17/1                       Flags        : D
    
     Destination  : 1::1                            PrefixLength : 128
     NextHop      : ::1                             Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : 10GE1/17/1                       Flags        : D
    
     Destination  : 5::5                            PrefixLength : 128
     NextHop      : ::1                             Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : LoopBack1                       Flags        : D
    
     Destination  : 6::6                            PrefixLength : 128
     NextHop      : 1::2                            Preference   : 255
     Cost         : 0                               Protocol     : EBGP
     RelayNextHop : 1::2                            TunnelID     : 0x0
     Interface    : 10GE1/17/1                       Flags        : RD
    
     Destination  : FE80::                          PrefixLength : 10
     NextHop      : ::                              Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : NULL0                           Flags        : D
    <CE1> ping ipv6 -a 5::5 6::6
    
      PING 6::6 : 56  data bytes, press CTRL_C to break
        Reply from 6::6 
        bytes=56 Sequence=1 hop limit=62 time=8 ms
        Reply from 6::6 
        bytes=56 Sequence=2 hop limit=62 time=2 ms
        Reply from 6::6 
        bytes=56 Sequence=3 hop limit=62 time=4 ms
        Reply from 6::6 
        bytes=56 Sequence=4 hop limit=62 time=3 ms
        Reply from 6::6 
        bytes=56 Sequence=5 hop limit=62 time=4 ms
      ---6::6 ping statistics---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max=2/4/8 ms

    After 6PE is configured, IPv6 networks where CE1 and CE2 reside can communicate through the IPv4/MPLS backbone network.

Configuration Files
  • Configuration file of CE1

    #
    sysname CE1
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 1::1/64
    #
    interface LoopBack1
     ipv6 enable
     ipv6 address 5::5/128
    #
    bgp 100
     router-id 5.5.5.5
     peer 1::2 as-number 200
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 5::5 128
      peer 1::2 enable
    #
    return
  • Configuration file of PE1

    #
    sysname PE1
    #
    mpls lsr-id 2.2.2.2
    #
    mpls
    #
    mpls ldp
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 1::2/64
    #
    interface 10GE1/17/2
     undo portswitch
     ip address 10.0.0.1 255.255.255.252
     mpls
     mpls ldp
    #
    interface LoopBack0
     ip address 2.2.2.2 255.255.255.255
    #
    bgp 200
     peer 3.3.3.3 as-number 200
     peer 3.3.3.3 connect-interface LoopBack0
     peer 1::1 as-number 100
     #
     ipv4-family unicast
      peer 3.3.3.3 enable
     #
     ipv6-family unicast
      peer 3.3.3.3 enable
      peer 3.3.3.3 label-route-capability
      peer 1::1 enable
    #
    ospf 1
     area 0.0.0.0
      network 2.2.2.2 0.0.0.0
      network 10.0.0.0 0.0.0.3
    #
    return
  • Configuration file of PE2

    #
    sysname PE2
    #
    mpls lsr-id 3.3.3.3
    #
    mpls
    #
    mpls ldp
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 2::2/64
    #
    interface 10GE1/17/2
     undo portswitch
     ip address 10.0.0.2 255.255.255.252
     mpls
     mpls ldp
    #
    interface LoopBack0
     ip address 3.3.3.3 255.255.255.255
    #
    bgp 200
     peer 2.2.2.2 as-number 200
     peer 2.2.2.2 connect-interface LoopBack0
     peer 2::1 as-number 300
     #
     ipv4-family unicast
      peer 2.2.2.2 enable
     #
     ipv6-family unicast
      peer 2.2.2.2 enable
      peer 2.2.2.2 label-route-capability
      peer 2::1 enable
    #
    ospf 1
     area 0.0.0.0
      network 3.3.3.3 0.0.0.0
      network 10.0.0.0 0.0.0.3
    #
    return
  • Configuration file of CE2

    #
    sysname CE2
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 2::1/64
    #
    interface LoopBack1
     ipv6 enable
     ipv6 address 6::6/128
    #
    bgp 300
     router-id 6.6.6.6
     peer 2::2 as-number 200
     #
     ipv4-family unicast
     #
     ipv6-family unicast
      network 6::6 128
      peer 2::2 enable
    #
    return
Translation
Download
Updated: 2019-08-09

Document ID: EDOC1000041694

Views: 59106

Downloads: 3623

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next