BGP Route Redistribution feature – External Peers

The figure shown below depicts the topology setup used for this configuration.

Figure 1. BGP Configuration and Testing Topology


Use the following commands to configure BGP routing.

  1. To enable BGP in Router R1:

    Execute the following commands:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Enter the Autonomous System (AS) number in R1.
    iS5comm(config)# as-num 100
    • Configure the router-id in R1.
    iS5comm(config)# router-id 12.0.0.1
    • Enable BGP in R1.
    iS5comm(config)# router bgp 100
    • Configure R2 (with as-num 200) as external peer in R1.
    iS5comm(config-router)# neighbor 12.0.0.2 remote-as 200

  2. To enable BGP in Router R2:

    Execute the following commands:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Enter the Autonomous System (AS) number in R2.
    iS5comm(config)# as-num 200
    • Configure the router-id in R2.
    iS5comm(config)# router-id 12.0.0.2
    • Enable BGP in R2.
    iS5comm(config)# router bgp 200
    • Configure R1 (with as-num 100) as external peer in R2.
    iS5comm(config-router)# neighbor 12.0.0.1 remote-as 100

  3. Verify that the BGP session between the internal peers R1 and R2 is established, using the following show commands in R1 and R2.

    Type the following:

    • R1: View the BGP summary information.
    iS5comm# show ip bgp summary
    BGP router identifier is 12.0.0.1, local AS number 100
    BGP table version is 0
    Neighbor Version AS MsgRcvdMsgSent Up/DownState/PfxRcd
     -------------------------------- ----------------
    12.0.0.2  4     200  2      2        00:00:00:13 Established

    • R2: View the BGP summary information.
    iS5comm# show ip bgp summary
    BGP router identifier is 12.0.0.2, local AS number 200
    BGP table version is 0
    Neighbor Version AS MsgRcvdMsgSent Up/DownState/PfxRcd
     -------------------------------- ----------------
    12.0.0.1  4     100  2      2        00:00:00:1 Established

    • Add static route in R1:
    iS5comm# configure terminal
    iS5comm(config)# ip route 92.0.0.0 255.0.0.0 20.0.0.1
    iS5comm(config)# exit
    iS5comm# show ip route
    C 12.0.0.0/8 is directly connected, vlan1
    C 20.0.0.0/8 is directly connected, vlan2
    S 91.0.0.0/8 [-1] via 20.0.0.1

    • In R1, redistribute the static route into BGP:
    iS5comm# configure terminal 
    iS5comm(config)# router bgp 100
    iS5comm(config-router)# redistribute static
    iS5comm(config-router)# end

    • Verify the BGP route in R2
    iS5comm# show ip bgp rib
    BGP table version is 1,local router ID is 12.0.0.2
    Status codes: d damped* valid, > best, i - internal
    Origin codes: i - IGP, e - EGP, ? - incomplete
    Network Next Hop Metric LocPrf Path
    ------- ---- --- ------------ ----
    *>i  91.0.0.0/8 12.0.0.1 100 ?

    • iS5comm# show ip route
    C 12.0.0.0/8 is directly connected, vlan1B 91.0.0.0/8 [-1] via 12.0.0.1

    • Delete the static route in R1.
    iS5comm# configure terminal
    iS5comm(config)# no ip route 92.0.0.0 255.0.0.0 20.0.0.1
    iS5comm(config)# end

    iS5comm# show ip route
    C 12.0.0.0/8 is directly connected, vlan1
    C 20.0.0.0/8 is directly connected, vlan2

    In R2 verify that BGP route is not present after deletion of the static route in R1.

    iS5comm# show ip bgp rib
    BGP table version is 0, local router ID is 0.0.0.0
    Status codes: d damped * valid, > best, i - internal
    Origin codes: i - IGP, e - EGP, ? - incomplete
     Network Next Hop Metric LocPrf Path
    ------- ---- --- ------ ------ ----

    iS5comm# show ip route
    C 12.0.0.0/8 is directly connected, vlan1