BGP Crib Notes

These are my ‘crib notes’ that I’ve made to serve as a last minute refresher. Please forgive the grammer / spelling as I did not develop these notes with publishing in mind

BGP

***theory***

  • Facts
  • BGP current version 4 and designed to route IP through Autonomous Systems. Is capable of MD5 Authentication
  • Two flavours: i-bgp (Routers in the same AS) and e-bgp
  • BGP uses TCP 179 to maintain neighbour / peer relationships
  • Routing policies are based on BGP attributes
  • Neighbours are manually configured. BGP is SLOW so be patient when configuring! NETWORKS are manual and so not advertised by default
  • Hello messages sent every 60 seconds.
  • Holddown is 180 seconds
    • Starts in IDLE state
    • Active – It’s a bad thing if it stuck in Active. Otherwise okay
    • Open sent – Sent a open session message to neighbour
    • Open Confirmed – When open message is received from neighbour
    • Established – Peer successful!
    • Reason to run BGP 1) You are a ISP 2) You have 2 Primary links to separate ISPs.
    • Rule of synchronisation: Routes learned in bgp must exist in the internal routing table before being advertise to remote peers. This is for scenario if there is a router in the AS not using BGP – Quite rare.
      • Turn sync off if every router is running bgp
      • Rule of split horizon – Rules learned via iBgp will never be sent to another iBGP peer as it assumes all routers are fully meshed, however that not always feasible in very large networks to have fully meshed connection. So we use route reflectors.
      • Route Reflectors: helps to get around the split horizon rule! Instead of a full mesh, one router can reflect routers careful of loops though!
      • Confederations: Allow for sub-AS systems using private AS numbers (64.512 – 65,535)
      • Peer Groups: create a template statement for number of neighbours! Simplifies the neighbour statement by using a tag word – groups same statements
      • Summarisation: aggregate-address 172.0.0.0 255.0.0.0 summary-only. Show ip bgp will have a s notated next to it to show it’s  been surpressed
        • use surpress-map to summarise address and then on the neighbour statement use the unsurpress-map statement to get full routes while other neighbours will get the summarisation. Use accless lists and route maps!
        • Distribute lists – suppresses route updates via access list and can narrow down to neighbour using neighbour 1.1.1.1 distribute-list 10 out. Can also use the following
          • Prefix list – used to fix short coming of old access list but named access list can be resequenced
          • Attributes: Highest Weight > Highest Local Pref > Routes that the router originated > Shortest AS PATH > Lowest Origin Code > Lowest MED > EBGP over IBGP >…
            • Well Known – Must be supported on all BGP routers
              • Mandatory – Must be included in ALL bgp updates
                • AS-Path: Prepends each AS and used for Loop prevention (if it sees it own AS in the prepend)
                • Next Hop: IP address of the next hop. Causes problems on NBMA multipoint networks like Frame Relay. Way to fix it is put as point to point link.
                • Origin: where did it come from?
                  • IGP (I)
                  • EGP  (E)– Old version and you will NEVER see this
                  • Unknown ? – Very COMMON, especially in redistribution.
            • Discretionary – Up to you
              • Local Preference: Gives you control over preferred routers beng learned. Higher is better. 
              • Atomic Aggregate: Informs a router that a route has been summarised.
  • Optional – Does not have to be supported
    • Transitive – Will travel all systems
      • Aggregator
      • Community – Tagging routes
      • Non Transitive  – Will not propagate all systems
        • Weight: Cisco. Control routes on the same router (higher is better). Weight does not affect the routing policy of other routers
        • MED: Tries to suggest entry points into your AS. E.g. suggest to upstream AS router to come into your network through the router you choose.  (lower is better)
        • Communities: use neighbour 1.1.1.1 send community and then the route map others there will be issues
          • Internet: default, bo tag
          • Local AS: Will not advertise outside local AS including confederations
          • No Advertise: Wont advertise to peer even IBGP – like a secret
          • None – Strips community tags
          • Route Manipulation
            • Local Preference: can set a local preference to prefer routes, however this propagates through the whole AS
            • Weight: Same as above, but stays local to router and doesn’t affect routing decision for other routers in the AS
            • Multihoming
              • Single Provider – dual link to same upstream router – Very rare to use BGP. Create two static routes (floating). May use BGP for keepalives
              • Real single provider.
              • Configuration
                • Always good to setup relationship between loopback addresses
                • Using loop back addresses
                  • Ebgp multihop  2– must uses this for ebgp relationships that uses loopback addresses.
                  • Update-source – must uses this for ebgp relationships that uses loopback addresses.
                  • Neighbour 192.167.34.1 next hop self – tells iBgp routers that it can access routers via this router
  • Network – must match the subnet, not like other protocols where advertisement is sent via that network and includes that network by using MASK keyword
  • Next hop = 0.0.0.0 means it is us / this router
  • * but no > – If there is no best route, it means the rule of synchronisation is in play
  • Show ip bgp regexp ^2005 – shows all routes in AS 2500. Can use in the access list!
    • ^ – Begins with
    • $ – ends with
    • . – something
    • _ – beginning / end of string and blank space
Advertisements

One Response

  1. A few things I like to emphasize:
    *In general, although this is often misstated, BGP does not carry policies. It carries the information on which policy decisions are made.
    *The actual policies (with the exception of outbound route filtering) are in routers, as in route maps
    *When compared to IGPs, BGP is a reachability protocol, rather than a “best route” protocol.

    Look at the Citizendium material, which is somewhat fragmentary. Could we cooperate and perhaps have the theory there and the Cisco configuration elsewhere, although I might inquire about creating configuration examples in CZ

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: