BGP Address-Family and Peer Groups

BGP can use multiple protocols like IPv4 Unicast, IPv4 Multicast, IPv6 Unicast, IPv6 Multicast, etc..… This means you need to have a way to tell BGP which protocol you want to use, and that’s where the address-family comes in. You’ll also use address-family for VRFs. This has been discussed for a long time, but I like to keep my configs clean and straightforward. I try to do things to make things easier for my co-workers. I sometimes feel people make things complicated for no reason. I’m sure we have all seen it. Or their reason is they think if they make it difficult, only they know it? Who knows, but that’s not how I roll :). I don’t want unnecessary configurations if I don’t need them. I also want to prevent human mistakes when I can help avoid them.

Let’s look at both options which do the same thing.

Traditional:

router bgp y.y.y.y
 bgp router-id z.z.z.z
 bgp log-neighbor-changes
 network 207.201.208.0
 neighbor {ISP-PEER-IP1} remote-as {ISP-ASN}
 neighbor {ISP-PEER-IP1} description ISP-PEER
 neighbor {ISP-PEER-IP1} soft-reconfiguration inbound
 neighbor {ISP-PEER-IP1} route-map BLAHBLAH_ROUTEMAP out
 neighbor {LOCAL-PEER-IP1} remote-as {LOCAL-ASN}
 neighbor {LOCAL-PEER-IP1} description ROUTER-B
 neighbor {LOCAL-PEER-IP1} next-hop-self
 neighbor {LOCAL-PEER-IP1} soft-reconfiguration inbound
 neighbor {LOCAL-PEER-IP1} route-map BLAHBLAH_ROUTEMAP out

Lines = 13

Address-Family:

router bgp y.y.y.y
 bgp router-id z.z.z.z
 bgp log-neighbor-changes
 neighbor {ISP-PEER-IP1} remote-as {ISP-ASN}
 neighbor {ISP-PEER-IP1} description ISP-PEER
 neighbor {LOCAL-PEER-IP1} remote-as {LOCAL-ASN}
 neighbor {LOCAL-PEER-IP1} description ROUTER-B
 !
address-family ipv4
  network x.x.x.x
  neighbor {ISP-PEER-IP1} activate
  neighbor {ISP-PEER-IP1} soft-reconfiguration inbound
  neighbor {ISP-PEER-IP1} route-map BLAHBLAH_ROUTEMAP out
  neighbor {LOCAL-PEER-IP1} activate
  neighbor {LOCAL-PEER-IP1} next-hop-self
  neighbor {LOCAL-PEER-IP1} soft-reconfiguration inbound
  neighbor {LOCAL-PEER-IP1} route-map BLAHBLAH_ROUTEMAP out
exit-address-family

Lines = 19

BGP is a multiprotocol protocol that may transport several address families thanks to the new NLRI. Almost two-dozen distinct NLRIs are now conveyed through BGP. For the new address families, new AFI and SAFI have been defined. As part of BGP’s Multiprotocol capabilities, the address family identification is communicated across BGP peers via the BGP OPEN message. During the BGP UPDATE message with the NLRI, it is used to define the network layer protocol associated with the network addresses that follow it.

First, I want to say that it only makes sense to use address-family if you’re going to use multiple protocols or VRFs. If you’re not going to use multiple protocols or VRFs, it doesn’t make sense. I want to make sure I can hand off configurations to engineers who might not know as much about BGP. I want them to either see it and say I got it or be able to learn it as quickly as possible with the least amount of explanation. Some things I can see happening are that they forget to activate the neighbor, or they are trying to put the “next-hop-self” in the wrong area, or they are trying to put the route map in the wrong area, and then comes the “it doesn’t work” :). I want to avoid this whenever I can. Avoid complexity whenever possible.

I’m all about KISS and this is not keeping it simple if you don’t need to use it. That’s my opinion 🙂 .

#PEER GROUPS

What I can see is using are BGP Peer Groups to help cleanup the BGP configuration. I like to use Peer Groups and think they’re great. I recommend them.  We may utilize Peer Groups to simplify BGP configuration and minimize the amount of updates BGP needs to produce. We can create a Peer Group with our neighbors and then apply all of our configurations. BGP will prepare updates for the Peer Group, which uses fewer CPU resources than individually processing updates for each neighbor.

router bgp y.y.y.y
 bgp router-id z.z.z.z
 bgp log-neighbor-changes
 network x.x.x.x
 neighbor IBGP peer-group
 neighbor IBGP remote-as {LOCAL-ASN}
 neighbor IBGP next-hop-self
 neighbor IBGP route-map BLAHBLAH_ROUTEMAP out
 neighbor {LOCAL-PEER-IP1} peer-group IBGP
 neighbor {LOCAL-PEER-IP2} peer-group IBGP
 neighbor {LOCAL-PEER-IP3} peer-group IBGP
 neighbor {ISP-PEER-IP1} remote-as {ISP-ASN}
 neighbor {ISP-PEER-IP1} description ISP-PEER
 neighbor {ISP-PEER-IP1} soft-reconfiguration inbound
 neighbor {ISP-PEER-IP1} route-map BLAHBLAH_ROUTEMAP out
 no auto-summary

Using peer-groups, we can see with three BGP Peers and the ISP, we are still less lines than the Address-Family configuration.

#NOTES

Some quick notes about the Address-Family config:
1. The moment you enter “address-family ipv4“, the whole config will convert to the new format. This is only one way and you can’t revert back. If you do a “no address-family ipv4“, you’ll have to redo your BGP config.

=====BEFORE the “address-family ipv4” command:

router bgp 1xxxx
 bgp router-id 222.222.222.1
 bgp log-neighbor-changes
 network 222.222.222.0
 neighbor 4.4.4.4 remote-as 1234
 neighbor 4.4.4.4 description ISP Peer
 neighbor 4.4.4.4 soft-reconfiguration inbound
 neighbor 4.4.4.4 route-map BGP-ADVERTISE-ISPA out
 neighbor 222.222.222.22 remote-as 1xxxx
 neighbor 222.222.222.22 description Cisco-ASR-B
 neighbor 222.222.222.22 next-hop-self
 neighbor 222.222.222.22 soft-reconfiguration inbound
 neighbor 222.222.222.22 route-map BGP-ADVERTISE-ISPA out

=====AFTER the “address-family ipv4” command:

router bgp 1xxxx
 bgp router-id 222.222.222.1
 bgp log-neighbor-changes
 neighbor 4.4.4.4 remote-as 1234
 neighbor 4.4.4.4 description ISP Peer
 neighbor 222.222.222.22 remote-as 1xxxx
 neighbor 222.222.222.22 description Cisco-ASR-B
 !
 address-family ipv4
  network 222.222.222.0
  neighbor 4.4.4.4 activate
  neighbor 4.4.4.4 soft-reconfiguration inbound
  neighbor 4.4.4.4 route-map BGP-ADVERTISE-ISPA out
  neighbor 222.222.222.22 activate
  neighbor 222.222.222.22 next-hop-self
  neighbor 222.222.222.22 soft-reconfiguration inbound
  neighbor 222.222.222.22 route-map BGP-ADVERTISE-ISPA out
 exit-address-family