BGP route reflector configuration example

Network requirements

As shown in Figure 73, all switches run BGP. Run EBGP between Switch A and Switch B, and run IBGP between Switch C and Switch B, and between Switch C and Switch D.

Configure Switch C as a route reflector with clients Switch B and Switch D to allow Switch D to learn route 20.0.0.0/8 from Switch C.

Figure 73: Network diagram

Configuration procedure

  1. Configure IP addresses for interfaces and configure OSPF in AS 200. (Details not shown.)

  2. Configure BGP connections:

    # Configure Switch A.

    <SwitchA> system-view
    [SwitchA] bgp 100
    [SwitchA-bgp-default] router-id 1.1.1.1
    [SwitchA-bgp-default] peer 192.1.1.2 as-number 200
    [SwitchA-bgp-default] address-family ipv4 unicast
    [SwitchA-bgp-default-ipv4] peer 192.1.1.2 enable
    

    # Inject network 20.0.0.0/8 to the BGP routing table.

    [SwitchA-bgp-default-ipv4] network 20.0.0.0
    [SwitchA-bgp-default-ipv4] quit
    [SwitchA-bgp-default] quit
    

    # Configure Switch B.

    <SwitchB> system-view
    [SwitchB] bgp 200
    [SwitchB-bgp-default] router-id 2.2.2.2
    [SwitchB-bgp-default] peer 192.1.1.1 as-number 100
    [SwitchB-bgp-default] peer 193.1.1.1 as-number 200
    [SwitchB-bgp-default] address-family ipv4 unicast
    [SwitchB-bgp-default-ipv4] peer 192.1.1.1 enable
    [SwitchB-bgp-default-ipv4] peer 193.1.1.1 enable
    [SwitchB-bgp-default-ipv4] peer 193.1.1.1 next-hop-local
    [SwitchB-bgp-default-ipv4] quit
    [SwitchB-bgp-default] quit
    

    # Configure Switch C.

    <SwitchC> system-view
    [SwitchC] bgp 200
    [SwitchC-bgp-default] router-id 3.3.3.3 
    [SwitchC-bgp-default] peer 193.1.1.2 as-number 200
    [SwitchC-bgp-default] peer 194.1.1.2 as-number 200
    [SwitchC-bgp-default] address-family ipv4 unicast
    [SwitchC-bgp-default-ipv4] peer 193.1.1.2 enable
    [SwitchC-bgp-default-ipv4] peer 194.1.1.2 enable
    [SwitchC-bgp-default-ipv4] quit
    [SwitchC-bgp-default] quit
    

    # Configure Switch D.

    <SwitchD> system-view
    [SwitchD] bgp 200
    [SwitchD-bgp-default] router-id 4.4.4.4
    [SwitchD-bgp-default] peer 194.1.1.1 as-number 200
    [SwitchD-bgp-default] address-family ipv4 unicast
    [SwitchD-bgp-default-ipv4] peer 194.1.1.1 enable
    [SwitchD-bgp-default-ipv4] quit
    [SwitchD-bgp-default] quit
    
  3. Configure Switch C as the route reflector.

    [SwitchC] bgp 200
    [SwitchC-bgp-default] address-family ipv4 unicast
    [SwitchC-bgp-default-ipv4] peer 193.1.1.2 reflect-client
    [SwitchC-bgp-default-ipv4] peer 194.1.1.2 reflect-client
    [SwitchC-bgp-default-ipv4] quit
    [SwitchC-bgp-default] quit
    

Verifying the configuration

# Display the BGP routing table on Switch B.

[SwitchB] display bgp routing-table ipv4

 Total number of routes: 1

 BGP local router ID is 2.2.2.2
 Status codes: * - valid, > - best, d - dampened, h - history,
               s - suppressed, S - stale, i - internal, e - external
               Origin: i - IGP, e - EGP, ? - incomplete

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

* >e 20.0.0.0           192.1.1.1       0                     0       100i

# Display the BGP routing table on Switch D.

[SwitchD] display bgp routing-table ipv4

 Total number of routes: 1

 BGP local router ID is 4.4.4.4
 Status codes: * - valid, > - best, d - dampened, h - history,
               s - suppressed, S - stale, i - internal, e - external
               Origin: i - IGP, e - EGP, ? - incomplete

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

* >i 20.0.0.0           193.1.1.2       0          100        0       100i

The output shows that Switch D has learned route 20.0.0.0/8 from Switch C.