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

Configuration Guide - IP Unicast Routing

CloudEngine 8800, 7800, 6800, and 5800 V200R005C10

This document describes the configurations of IP Unicast Routing, including IP Routing, Static Route, RIP, RIPng, OSPF, OSPFv3, IPv4 IS-IS, IPv6 IS-IS, BGP, Routing Policy, and PBR.
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).
Example for Configuring the BGP Community Attribute

Example for Configuring the BGP Community Attribute

Networking Requirements

As shown in Figure 9-26, EBGP connections are established between SwitchB and SwitchA, and between SwitchB and SwitchC. It is required that AS 20 not advertise the routes advertised by AS 10 to AS 30.

Figure 9-26 Networking diagram of configuring the BGP Community attribute



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a route-policy on SwitchA 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 SwitchC.

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

    The configurations of SwitchA and SwitchB are similar to the configuration of SwitchC, and are not mentioned here.

  2. Configure EBGP connections.

    # Configure SwitchA.

    [~SwitchA] bgp 10
    [*SwitchA-bgp] router-id 172.16.1.1
    [*SwitchA-bgp] peer 192.168.2.2 as-number 20
    [*SwitchA-bgp] ipv4-family unicast
    [*SwitchA-bgp-af-ipv4] network 10.1.1.0 255.255.255.0
    [*SwitchA-bgp-af-ipv4] commit
    [~SwitchA-bgp-af-ipv4] quit

    # Configure SwitchB.

    [~SwitchB] bgp 20
    [*SwitchB-bgp] router-id 172.16.2.2
    [*SwitchB-bgp] peer 192.168.2.1 as-number 10
    [*SwitchB-bgp] peer 192.168.3.2 as-number 30
    [*SwitchB-bgp] commit
    [~SwitchB-bgp] quit

    # Configure SwitchC.

    [~SwitchC] bgp 30
    [*SwitchC-bgp] router-id 172.16.3.3 
    [*SwitchC-bgp] peer 192.168.3.1 as-number 20
    [*SwitchC-bgp] commit
    [~SwitchC-bgp] quit

    # View the BGP routing table of SwitchB.

    [~SwitchB] display bgp routing-table 10.1.1.0
    
    
    BGP local router ID : 172.16.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 10.1.1.0/24:
     From: 192.168.2.1 (172.16.1.1)
     Route Duration: 0d00h00m37s
     Direct Out-interface: Vlanif20
     Original nexthop: 192.168.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:
        192.168.2.1
        192.168.3.2
    

    The preceding command output shows that SwitchB has advertised the received route to SwitchC in AS 30.

    # View the BGP routing table of SwitchC.

    [~SwitchC] display bgp routing-table
    
    
     BGP Local router ID is 172.16.3.3
     Status codes: * - valid, > - best, d - damped, 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
    
    
     *>   10.1.1.0/24        192.168.3.1                           0      20 10i

    The preceding command output shows that SwitchC has learned the route to 10.1.1.0/24 from SwitchB.

  3. Configure the BGP Community attribute.

    # Configure a route-policy on SwitchA to prevent SwitchB from advertising the routes advertised by SwitchA to AS 30.

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

    # Apply the route-policy.

    [~SwitchA] bgp 10
    [~SwitchA-bgp] ipv4-family unicast
    [~SwitchA-bgp-af-ipv4] peer 192.168.2.2 route-policy comm_policy export
    [*SwitchA-bgp-af-ipv4] peer 192.168.2.2 advertise-community
    [*SwitchA-bgp-af-ipv4] commit

    # View the BGP routing table of SwitchB.

    [~SwitchB] display bgp routing-table 10.1.1.0
    
    
    BGP local router ID : 172.16.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 10.1.1.0/24:
     From: 192.168.2.1 (172.16.1.1)
     Route Duration: 0d00h00m12s
     Direct Out-interface: Vlanif20
     Original nexthop: 192.168.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 SwitchB, you can view the configured Community attribute. There is no route to 10.1.1.0/24 in the BGP routing table of SwitchC.

Configuration Files

  • Configuration file of SwitchA

    #
    sysname SwitchA
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ip address 10.1.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 192.168.2.1 255.255.255.0
    #
    interface 10GE1/0/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    interface 10GE1/0/2
     port link-type trunk
     port trunk allow-pass vlan 20 
    #
    bgp 10
     router-id 172.16.1.1
     peer 192.168.2.2 as-number 20
     #
     ipv4-family unicast
      network 10.1.1.0 255.255.255.0
      peer 192.168.2.2 enable
      peer 192.168.2.2 route-policy comm_policy export
      peer 192.168.2.2 advertise-community
    #
    route-policy comm_policy permit node 10
     apply community no-export
    #
    return
  • Configuration file of SwitchB

    #
    sysname SwitchB
    #
    vlan batch 20 30
    #
    interface Vlanif20
     ip address 192.168.2.2 255.255.255.0
    #
    interface Vlanif30
     ip address 192.168.3.1 255.255.255.0
    #
    interface 10GE1/0/2
     port link-type trunk
     port trunk allow-pass vlan 20 
    #
    interface 10GE1/0/3
     port link-type trunk
     port trunk allow-pass vlan 30 
    #
    bgp 20
     router-id 172.16.2.2
     peer 192.168.2.1 as-number 10
     peer 192.168.3.2 as-number 30
     #
     ipv4-family unicast
      peer 192.168.2.1 enable
      peer 192.168.3.2 enable
    #
    return
  • Configuration file of SwitchC

    #
    sysname SwitchC
    #
    vlan batch 30
    #
    interface Vlanif30
     ip address 192.168.3.2 255.255.255.0
    #
    interface 10GE1/0/3
     port link-type trunk
     port trunk allow-pass vlan 30 
    
    #
    bgp 30
     router-id 172.16.3.3
     peer 192.168.3.1 as-number 20
     #
     ipv4-family unicast
      peer 192.168.3.1 enable
    #
    return
Translation
Download
Updated: 2019-04-20

Document ID: EDOC1100074760

Views: 45719

Downloads: 58

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