Technology

BGP Neighborship States And Attributes?

  1. Idle – neighbor shutdown/waiting for start 3-way handshake.
  2. Connect – try to connect TCP connection but won’t be confirmed.
  3. Active – TCP connection not completed, retrying to form tcp connection.
  4. Open-sent – TCP connection completed and sent the open message.
  5. Open-confirm – exchange open message, parameter agreed, send keep-alive after 60 seconds.
  6. Established – peering completed, the update is exchanged.

What are the types of neighbors in BGP?

IBGP – internal border gateway protocol.

EBGP – external border gateway protocol.

How to establish a neighborship in bgp?

router# debug ip tcp packet

router# debug ip bgp all

router(config)# router bgp 100

router(config-router) # neighbor 12.1.1.1 remote-as 200

router# show tcp brief

router# show ip bgp neighbor

router# show ip route

router# show ip bgp

HOW TO ADVERTISE PREFIX?

router(config)# router bgp 100

router(config-router) # network 172.16.0.0 mask 255.255.0.0

  • We can advertise the network, but its prefix length should be matched in its routing table connected route.
  • It will install only the best route of the bgp table into the routing table.

What are bgp path attributes?

Well known mandatory – bgp will always carry these attributes with bgp update automatically.

Well known discretionary – sometimes bgp will carry these attributes with bgp update, sometimes it’s not. It depends on the neighbor, its ibgp neighbor, and ebgp neighbor.

Optional transitive – if any bgp neighbor receives any update with an optional transitive attribute and that router doesn’t support that attribute in that case it will not drop the update, it will accept that update and it will forward it to another neighbor after removing that attribute.

Optional non-transitive – if any bgp neighbor receives any update with an optional non-transitive attribute and that router doesn’t support that attribute that case it will discard that incoming update.

How does bgp define the best path?

  1. Next-hop – reachability, if the next hop is not reachable then it will not compare another path attribute if any router receives any prefix from two neighbors and next-hop is reachable via both routers, then bgp will not define the best path based on next-hop only.
  2. Weight – It is cisco proprietary, and it has logical significance. Bgp will not carry weight information with the bgp update. For self-advertised prefixes, it is by default 32768. For all received prefixes by default, it is 0. Higher weight will always be preferred.
  3.  Local preference – bgp will always include the local preference attribute in its outgoing bgp update but only for the ibgp neighbor. By default, local preference is 100 for internal prefixes. Higher local preference will always be preferred. If any router receives prefixes from ebgp neighbor (0), and from ibgp neighbor (100) in that case, local preference will never compare.
  4. Self-advertised – self-advertised prefix will be preferred. If the router is receiving the same prefix from a different neighbor, then it will not compare self-advertised. 
  5. As-path – as-path can have a maximum of 64 as’s. The router will define that path as best which is providing destination network after crossing a smaller number of as. A prefix which is having less number of as available inside its as-path list.
  6. Origin code – I = if we are advertising route in bgp with the network command.
  7. E = if any route advertised in egp.
  8. ? = if we are redistributing anything in bgp by default origin code will be “?”.
  9. I>E>?
  10. Med (metric) – by default med is 0. Lower med will always be preferred. If we redistribute any routing protocol in bgp, their metric will go along with bgp update in the form of med. Sometimes metric will be 0 sometimes not.
  11. External>internal – if any prefix comes from to different neighbor one is ebgp and one is ibgp then it will be preferred external first.
  12. Igp cost to reach next-hop – if igp is configured in the background of bgp then bgp uses igp cost to reach the next-hop address.
  13. Oldest path (for ebgp neighbor only) – if a router is receiving the same prefix coming from two different ebgp neighbors then the oldest path always be preferred.
  14. Router-id of neighbor – lower router-id will always be preferred. If the router is receiving the same prefix coming from two different igp neighbors, then the lower router-id of neighbor always be preferred.
  15. Lower neighbor address – if a router is receiving the same prefix coming from two neighbors which router-id is has the same then a lower ip address will always be preferred.

Zindagi technology is a lead IT consulting company. We have successfully completed lots of IT projects. We provide IT solutions like data centers, cyber security, planning, designing, and implementation of data centers, cloud-based services, application development, etc. we can assist you in your network programs. You can ping us at +91-9773973971 and email us at [email protected].

Author
Lokesh Sharma
Associate Consultant

Leave a comment

Your email address will not be published.