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

CLI-based Configuration Guide - IP Unicast Routing

AR100, AR120, AR150, AR160, AR200, AR1200, AR2200, AR3200, and AR3600 V200R009

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-35, EBGP connections are established between Router B and Router A, and between Router B and Router C. It is required that AS 20 not advertise the routes advertised by AS 10 to AS 30.

Figure 9-35 Networking diagram of configuring the BGP community

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a route-policy on RouterA 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 an IP address for each interface.

    # Configure IP addresses for all interfaces of RouterA.

    <Huawei> system-view
    [Huawei] sysname RouterA
    [RouterA] interface gigabitethernet 1/0/0
    [RouterA-GigabitEthernet1/0/0] ip address 9.1.1.1 255.255.255.0
    [RouterA-GigabitEthernet1/0/0] quit
    [RouterA] interface gigabitethernet 2/0/0
    [RouterA-GigabitEthernet2/0/0] ip address 200.1.2.1 255.255.255.0
    [RouterA-GigabitEthernet2/0/0] quit

    The configurations of RouterB and RouterC are similar to the configuration of RouterA, and are not mentioned here.

  2. Establish EBGP connections.

    # Configure Router A.

    [RouterA] bgp 10
    [RouterA-bgp] router-id 1.1.1.1
    [RouterA-bgp] peer 200.1.2.2 as-number 20
    [RouterA-bgp] ipv4-family unicast
    [RouterA-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
    [RouterA-bgp-af-ipv4] quit
    [RouterA-bgp] quit

    # Configure Router B.

    [RouterB] bgp 20
    [RouterB-bgp] router-id 2.2.2.2
    [RouterB-bgp] peer 200.1.2.1 as-number 10
    [RouterB-bgp] peer 200.1.3.2 as-number 30
    [RouterB-bgp] quit

    # Configure Router C.

    [RouterC] bgp 30
    [RouterC-bgp] router-id 3.3.3.3 
    [RouterC-bgp] peer 200.1.3.1 as-number 20
    [RouterC-bgp] quit

    # On Router B, view detailed information about route 9.1.1.0/24.

    [RouterB] 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
     BGP routing table entry information of 9.1.1.0/24:
     From: 200.1.2.1 (1.1.1.1)
     Route Duration: 00h00m42s
     Direct Out-interface: GigabitEthernet2/0/0
     Original nexthop: 200.1.2.1
     Qos information : 0x0
     AS-path 10, origin igp, MED 0, pref-val 0, valid, external, best, select, active, pre 255
     Advertised to such 2 peers:
        200.1.2.1
        200.1.3.2

    The preceding command output shows that Router B advertises the received BGP route to Router C in AS 30.

    # View the BGP routing table of Router C.

    [RouterC] display bgp routing-table
     BGP Local router ID is 3.3.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
    
     *>   9.1.1.0/24         200.1.3.1                             0      20 10i

    The preceding command output shows that Router C has learned route 9.1.1.0/24 from Router B.

  3. Configure a BGP community attribute.

    # Configure a routing policy on Router A to prevent BGP routes to be advertised by Router A to Router B from being advertised to any other AS.

    [RouterA] route-policy comm_policy permit node 10
    [RouterA-route-policy] apply community no-export
    [RouterA-route-policy] quit

    # Apply the routing policy.

    [RouterA] bgp 10
    [RouterA-bgp] ipv4-family unicast
    [RouterA-bgp-af-ipv4] peer 200.1.2.2 route-policy comm_policy export
    [RouterA-bgp-af-ipv4] peer 200.1.2.2 advertise-community

    # On Router B, view detailed information about route 9.1.1.0/24.

    [RouterB] 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
     BGP routing table entry information of 9.1.1.0/24:
     From: 200.1.2.1 (1.1.1.1)
     Route Duration: 00h00m09s
     Direct Out-interface: GigabitEthernet2/0/0
     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, active, pre 255
     Not advertised to any peer yet
    

    The preceding command output shows that route 9.1.1.0/24 carries the configured community attribute and Router B does not advertise this route to any other AS.

Configuration Files

  • Configuration file of Router A

    #
     sysname RouterA
    #
    interface GigabitEthernet1/0/0
     ip address 9.1.1.1 255.255.255.0
    #
    interface GigabitEthernet2/0/0
     ip address 200.1.2.1 255.255.255.0
    #
    bgp 10
     router-id 1.1.1.1
     peer 200.1.2.2 as-number 20
     #
     ipv4-family unicast
      undo synchronization
      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 Router B

    #
     sysname RouterB
    #
    interface GigabitEthernet1/0/0
     ip address 200.1.3.1 255.255.255.0
    #
    interface GigabitEthernet2/0/0
     ip address 200.1.2.2 255.255.255.0
    #
    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
      undo synchronization
      peer 200.1.2.1 enable
      peer 200.1.3.2 enable
    #
    return
  • Configuration file of Router C

    #
     sysname RouterC
    #
    interface GigabitEthernet1/0/0
     ip address 200.1.3.2 255.255.255.0
    #
    bgp 30
     router-id 3.3.3.3
     peer 200.1.3.1 as-number 20
     #
     ipv4-family unicast
      undo synchronization
      peer 200.1.3.1 enable
    #
    return
Translation
Download
Updated: 2019-05-17

Document ID: EDOC1000174069

Views: 128638

Downloads: 274

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