Archive

Archive for September, 2007

BGP with A+B links to the same AS (primary+backup)

September 1st, 2007

here’s something i kinda use to one of our carriers. I’ll put some ! comments in it for you less than intelligent/wannabe network geeks :)

 
! We can do this with a public ASN or a private ASN+proxy aggregate
router bgp 12345
  ! Announce our blocks, a /23
 network 1.1.1.0 255.255.254.0
  ! Forgive a missed BGP keepalive
 no bgp fast-external-fallover
  ! Log ALL changes
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 1234
  ! hardcode BGP to version 4 to save some overhead during warmup
 neighbor 2.2.2.2 version 4
  ! use communities
 neighbor 2.2.2.2 send-community
  ! We define our prefix list filters for just a default route. 
  ! We use this to prevent our upstream from blowing up and sending us 
  ! transit tables causing this switch/router to melt with 250k prefixes :)
  neighbor 2.2.2.2 prefix-list default in
  ! Be a good netcitizen and aggregate our prefixes into one /23 announcement.
  neighbor 2.2.2.2 prefix-list aggregate out
  neighbor 3.3.3.3 remote-as 1234
  neighbor 3.3.3.3 prefix-list aggregate out
  neighbor 3.3.3.3 route-map backup-out out
  neighbor 3.3.3.3 prefix-list default in
  neighbor 3.3.3.3 route-map backup-in in
 
 route-map backup-in permit 10
  set local-preference 90
 route-map backup-out permit 10
  match ip address prefix-list aggregate
  set metric 10
 route-map backup-out permit 20
 ! Only announce our aggregate
 ip prefix-list aggregate permit 1.1.1.0/23
 ! Permit ONLY the default route. This is a sanity filter to prevent this switch/router from taking all routes.
 ip prefix-list default permit 0.0.0.0/0
 ! We need this underlying route to allow our bgp sessions to work
 ip route 1.1.1.0 255.255.254.0 Null0

Networking