BGP update source

Written on by admin on. Posted in BGP

For BGP, a neighbor relationship to be established, source IP address of BGP packets sent by a router must be the same as neighbor ip-address set on the neighboring router. By default, packet’s source IP address is outgoing interface.

But, what if will need to have two paths between BGP neighbors, which one to use to establish neighbor relationship? Please, Take a look at the topology.

BGP update source

In scenario above you see that there are two links between First router and Second router. We can establish two neighbor relationships, on both paths, but this is not a solution. So, we’ll establish only one neighborship with each other. BGP gives us an option to change the source of packets sent. In this case we can use Loopback interface as source of BGP packets sent between these neighbors. By using  a loopback interface as source interface we have two paths between them, if one of paths fails, the other one will be used.

By using a loopback interface as update source, we also benefit from the fact that BGP session won’t go down when physical interface goes down.

Update source can be configured per neighbor or per peer-group. To configure update source use the following command:

neighbor {ip-addr | group-name} update-source interf

 where ip-addr | group-name  is ip address of the neighbor or peer-group name, interf – is interface that will be used as update source. If you are interested in peer-group check BGP Peer Group lab.

Connection between all interfaces in this topology I provided by using EIGRP:

First(config)#router eigrp 1
First(config-router)# network 10.0.0.0
First(config-router)# network 192.168.0.0
First(config-router)# network 192.168.1.0
First(config-router)# no auto-summary
Second(config)#router eigrp 1
Second(config-router)# network 10.0.0.0
Second(config-router)# network 192.168.0.0
Second(config-router)# network 192.168.1.0
Second(config-router)# no auto-summary

Further I will show configuration related to BGP, check them below.

First
First(config)#router bgp 65000
First(config-router)#neighbor 10.0.0.1 remote-as 65000 
First(config-router)#neighbor 10.0.0.1 update-source loopback 0 
Second
Second(config)#router bgp 65000
Second(config-router)#neighbor 10.0.1.1 remote-as 65000
Second(config-router)#neighbor 10.0.1.1 update-source loopback 0 

I’ve highlighted commands where update-source is changed. Now they are neighbors, we’ll check this on First router.

First#show ip bgp summary 
BGP router identifier 10.0.1.1, local AS number 65000
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.0.0.1        4 65000       7       7        1    0    0 00:04:42        0
First#
That’s all for this lab, thanks for your time!
19183 views

Comments (10)

  • Anonymous

    |

    if one of the physical links go down..,BGP neighbor relationshio wion’t go down..but the two physical liinks go dwon..neighborrelatonshio will go down..?

    Reply

    • admin

      |

      I this case yes. If there will be a mesh topology, where another path between routers will be available, then neighbor relationship will not go down.

      Reply

  • king

    |

    hi loop backs are not pinging .

    Reply

  • king

    |

    i am getting as

    Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
    10.0.0.1        4 65000       0       0        0    0    0 never    Active
    

    kindly explain

    Reply

    • admin

      |

      Hi, i suppose that in your case routing tables don’t have route to the other’s router loopback IP address. First, check routing tables on routers, and if there are no routes to loopback interfaces of the other router then you need to use a routing protocol or at least static routes to achieve that. In my example your output should like this:

      First#show ip route 
      Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
             D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
             N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
             E1 - OSPF external type 1, E2 - OSPF external type 2
             i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
             ia - IS-IS inter area, * - candidate default, U - per-user static route
             o - ODR, P - periodic downloaded static route
      
      Gateway of last resort is not set
      
           10.0.0.0/32 is subnetted, 2 subnets
      C       10.0.1.1 is directly connected, Loopback0
      D       10.0.0.1 [90/409600] via 192.168.1.2, 00:11:46, FastEthernet0/1
                       [90/409600] via 192.168.0.2, 00:11:46, FastEthernet0/0
      C    192.168.0.0/24 is directly connected, FastEthernet0/0
      C    192.168.1.0/24 is directly connected, FastEthernet0/1
      First#
      
      Second#show ip route 
      Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
             D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
             N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
             E1 - OSPF external type 1, E2 - OSPF external type 2
             i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
             ia - IS-IS inter area, * - candidate default, U - per-user static route
             o - ODR, P - periodic downloaded static route
      
      Gateway of last resort is not set
      
           10.0.0.0/32 is subnetted, 2 subnets
      D       10.0.1.1 [90/409600] via 192.168.1.1, 00:12:03, FastEthernet0/1
                       [90/409600] via 192.168.0.1, 00:12:03, FastEthernet0/0
      C       10.0.0.1 is directly connected, Loopback0
      C    192.168.0.0/24 is directly connected, FastEthernet0/0
      C    192.168.1.0/24 is directly connected, FastEthernet0/1
      Second#
      

      If, you want to use EIGRP like I did, your EIGRP configurations should look like these:

      First#sh running-config | section router eigrp
      router eigrp 1
       network 10.0.0.0
       network 192.168.0.0
       network 192.168.1.0
       no auto-summary
      First#
      
      Second#show running-config | section router eigrp
      router eigrp 1
       network 10.0.0.0
       network 192.168.0.0
       network 192.168.1.0
       no auto-summary
      Second#
      

      Please post your feedback to see if it helped!

      Reply

  • shahzad

    |

    If we don’t use update source loop back command, will we be able to establish BGP neighbourship with loop back? will we be receiving routes from our neighbour with the loopback address used for BGP.

    Reply

    • admin

      |

      No, you will not be able to establish neighbor relationship with loopback if you don’t specify the loopback as update source.

      Reply

  • Maruthees R

    |

    What if we don’t use loopback interfaces and have physical interfaces , in that case is it necessary to give update source ?

    Reply

    • admin

      |

      If BGP packets are sent out through the physical interface, which has the same IP address as the IP address used by opposite router to establish neighbor relationship with this router, then you don’t need to set update source.

      Reply

      • Maru

        |

        What in case we don’t use any loopbacks and still establish neighbor relationships for the two links , in that case which interface BGP chooses as source 192.168.0.1 or 192.168.1.1 for the First router ? Will it prefer the higher ip address or simply doesn’t establishes neighbour relationship ?

        First:
        neighbour 192.168.0.2 remote-as 6500
        neighbor 192.168.1.2 remote-as 6500

        Second:
        neighbour 192.168.0.1 remote-as 6500
        neighbour 192.168.1.1 remote-as 6500

        Reply

Leave a comment


− one = 2