BGP is capable of using multiple protocols like IPv4 Unicast, IPv4 Multicast, IPv6 Unicast, IPv6 Multicast, etc… This basically 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’m one of those people who likes to keep my configs simple and clean. I try to do things to make things easier for my co-workers. I sometimes feel people make things complicated for no reason. Or their reason is they think if they make it complicated, 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.
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
First I want to say that, to me, 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, then it doesn’t make sense to use it. I want to make sure I can hand off configurations to engineers who might not know as much about BGP. I want them to be able either see it and say I got it or be able to learn it as quick as possible with the least amount of explanation. Some things I can see happening is 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 🙂 .
What I can see is using BGP Peer Groups to help cleanup the BGP configuration. I like to use peer-groups and think they’re great.
router bgp y.y.y.y bgp router-id z.z.z.z bgp log-neighbor-changes network x.x.x.x neighbor LOCAL peer-group neighbor LOCAL remote-as {LOCAL-ASN} neighbor LOCAL next-hop-self neighbor LOCAL route-map BLAHBLAH_ROUTEMAP out neighbor {LOCAL-PEER-IP1} peer-group LOCAL neighbor {LOCAL-PEER-IP2} peer-group LOCAL neighbor {LOCAL-PEER-IP3} peer-group LOCAL 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.
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