BGP 4 features examples

The 2 next-hops: local and global

In the BGP routing protocol, BGP router must advertise to its peer the network address of the next hop. The BGP router advertises to its peer the global IPv6 address of the next hop.

It is possible however, in case many routers are sharing a common link, that one of the BGP router advertises to its peers an IPv6 link-local address of the next hop.

The following example describes how the IGP are important with BGP and the synchronization feature.

let’s start with the IPv4 case:

../../../../../_images/resolution-of-the-next-hop-with-bgp-4.png

Next-hop resolution with BGP 4

rt1

eth0_0
      ipaddress 10.1.1.9/29
eth1_0
      ipaddress 172.16.255.254/30

rtg
      router bgp 65520
           neighbor 172.16.255.253 remote-as 65500
           neighbor 10.1.1.2 remote-as 65520
           neighbor 10.1.1.11 remote-as 65520
           neighbor 10.1.1.10 remote-as 65520
      exit
      router rip
           network 10.0.0.0/8
           network 192.168.0.0/16
      exit

rt2

eth0_0
      ipaddress 10.1.1.10/29
eth1_0
      ipaddress 192.168.2.1/24

rtg
      router bgp 65520
           neighbor 10.1.1.9 remote-as 65520
           neighbor 10.1.1.11 remote-as 65520
           neighbor 10.1.1.2 remote-as 65520
           network 192.168.2.0/24
      exit
      router rip
           network 10.0.0.0/8
           network 192.168.0.0/16
      exit

rt3

eth0_0
      ipaddress 10.1.1.11/29
eth1_0
      ipaddress 10.1.1.1/29
loopback
      loop 1 192.168.3.0/24

rtg
      router bgp 65520
           neighbor 10.1.1.9 remote-as 65520
           neighbor 10.1.1.10 remote-as 65520
           neighbor 10.1.1.2 remote-as 65520
           network 192.168.3.0/24
      exit
      router rip
           network 10.0.0.0/8
           network 192.168.0.0/16
      exit

rt4

eth0_0
      ipaddress 192.168.4.1/24
eth1_0
      ipaddress 10.1.1.2/29

rtg
      router bgp 65520
           neighbor 10.1.1.1 remote-as 65520
           neighbor 10.1.1.9 remote-as 65520
           neighbor 10.1.1.10 remote-as 65520
           network 192.168.4.0/24
      exit
      router rip
           network 10.0.0.0/8
           network 192.168.0.0/16
      exit

rt5

eth0_0
      ipaddress 172.16.0.1/16
eth1_0
      ipaddress 172.16.255.253/30

rtg
      router bgp 65500
           neighbor 172.16.255.254 remote-as 65520
           network 172.16.0.0/16

rt3{}show routing ip bgp
BGP table version is 0, local router ID is 192.168.3.0
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i -IGP, e - EGP, ? - incomplete

Network         Next Hop         Metric  LocPrf  Weight  Path
* i172.16.0.0   172.16.255.253        0     100       0  65500 i
*>i192.168.2.0  10.1.1.10             0     100       0  i
*> 192.168.3.0  0.0.0.0               0           32768  i
*>i192.168.4.0  10.1.1.2              0     100       0  i

Total number of prefixes 4

rt3 cannot route to the network 172.16.0.0/16 because the IGP does not announce a route to 172.16.255.252/30, which is necessary to join the next-hop 172.16.255.253 of the following AS-PATH.

rt3{}show routing ip bgp 172.16.0.0
BGP routing table entry for 172.16.0.0/16
Paths: (1 available, no best path)
  Not advertised to any peer
  65500
    172.16.255.253 (inaccessible) from 10.1.1.9 (172.16.255.254)
      Origin IGP, metric 0, localpref 100, valid, internal
      Last update: Mon Sep 4 21:32:56 2000

It can be fixed either by adding a static route to the 172.16.0.0/16 network on all routers of AS 65520, or by redistributing rt1’s connected addresses into the IGP:

router bgp 65520
  neighbor 172.16.255.253 remote-as 65500
  neighbor 10.1.1.2 remote-as 65520
  neighbor 10.1.1.11 remote-as 65520
  neighbor 10.1.1.10 remote-as 65520
exit
router rip
  network 10.0.0.0/8
  network 192.168.0.0/16
  redistribute connected
exit

Note

Trying to solve the problem by adding the line network 172.16.0.0/16 or network eth1_0 in the RIP configuration would be an error: it would result in activating RIP on rt1’s external interface, which would inject AS 65520’s IGP routes into AS 65500’s IGP.

Flushing BGP 4 sessions

If you have configured or changed a policy with a BGP neighbor, you should manually reset a BGP session. You may also want to reset sessions each time you think there is a problem of integrity with neighbor’s information.

  • Flush BGP 4 sessions:

    router{}flush routing [ip] bgp * ([soft] in|out)|rsclient
    router{}flush routing [ip] bgp A.B.C.D ([soft] in|out)|rsclient
    
    • All remote BGP peers
    A.B.C.D

    IPv4 address of the remote BGP peer.

    soft

    Soft reconfig.

    in

    Inbound update.

    out

    Outbound update

    rsclient

    Soft reconfig for rsclient RIB.

If you used the keyword soft, the session is not reset but all routing updates are resent, therefore the following command is generally advised when you configured a route-map or a filter and you want to update the neighbor’s BGP data:

router{}flush routing bgp A.B.C.D soft out

Another example is to use the following command to reset a session with a specific neighbor. The relationship will become idle and then be established again:

router{}flush routing bgp A.B.C.D out

Conversely, the keyword in is used for inbound reconfiguration.

Example

router{}flush routing bgp A.B.C.D soft in

Route refresh

Route refresh is an extension to BGP that is defined in RFC 2918. Using this feature, a BGP router can request a complete retransmission of the peer’s routing information without tearing down and reestablishing the BGP session, saving a route flap. It is used to facilitate routing policy changes, without storing an unmodified copy of the peer’s routes on the local router to save RAM. The capability must be supported by both routers of a BGP session. When both routers in the peering session support this extension, each router will respond to requests issued from the peer without operator intervention.

Route Refresh is enabled by default.

When the command flush is used, Route Refresh messages are sent to the peers, the router receives one or more Update packets with all the routes of the Adj-RIB-Out.

Example

router{}flush routing bgp * soft in
router{}show routing ip route
router{}show routing ip bgp neighbors
BGP neighbor is 10.23.0.1, remote AS 1, local AS 2, external link
  BGP version 4, remote router ID 10.23.0.1
  BGP state = Established, up for 00:01:49
  Last read 00:00:49, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent Rcvd
    Opens:                  1    0
Notifications:              0    0
Updates:                    4    2
Keepalives:                 3    2
Route Refresh:              1    0
Capability:                 0    0
Total:                      9    4