Table of contents (for this page):
BGP and IPv6 routing coursesSeveral times a year I teach a training course about BGP in association with NL-ix. The course consists of a theory part in the morning and a practical part in the afternoon where the participants implement several assignments on a Cisco router or a VM running the Quagga routing software.
The next dates are:
If you have several people who can benefit from the BGP training course or an IPv6 training course, I can teach a course at your location, in Dutch or English. Please email me to discuss the details.
Interdomain Routing & IPv6 News
This Thursday I'll be at the NL-ix BGP security update event in Copenhagen, talking about BGP security topics, especially RPKI and BGPsec. I remember the first time I went to the IETF in 2002, where I heard about S-BGP and soBGP. And now last September that finally resulted in the publication of the BGPsec RFC (RFC 8205).
It's not too late to register, so I hope to see you there! Be sure to come say hi.
My next BGP training course will be an extra scary Halloween edition. So come for the BGP, and stay for the scary stories. And the candy, of course.
A Halloween costume, or at least some vampire fangs or something, are recommended but not required.
One of the tiebreakers in the BGP best path selection algorithm is to prefer the path learned from a BGP speaker with the lowest BGP identifier. So how are BGP identifier selected when they're not configured explicitly?
I always forget whether it's the highest or the lowest IP address configured on a Cisco router. Turns out this is remarkably hard to find in Google, but if you know where to look it's in Cisco's IOS command reference:
When I first started running IPv6 over BGP, I ran into an interesting problem. The Cisco router I was working on had four full BGP feeds over IPv4. But when did show ip bgp, I noticed the router had five copies of each prefix. One of these paths had a really weird next hop address and was marked as unreachable.
Turned out those were IPv4 prefixes learned over an IPv6 BGP session.
What had happened was that when adding an IPv6 BGP session, I didn't specifically tell the router to not do IPv4 over that session. So despite the session being between two IPv6 addresses, the routers on both sides negotiated the use of the IPv4 unicast address family over that session, and thus exchanged IPv4 prefixes.
The problem with that is that BGP's automatic next hop processing then doesn't work: normally, the next hop is set to the IP address the router uses for the TCP session that BGP runs over. So when router 192.0.2.1 sends IPv4 prefixes to router 192.0.2.2, it sets the next hop attribute in those updates to 192.0.2.1. That doesn't work so well when the IP addresses for that BGP session are 2001:db8::1 and 2001:db8::2. What actually seems to happen is that the routers set the IPv4 next hop address to the first 32 bits of the IPv6 address used for the BGP TCP session...
So this is why for eBGP, we recommend using an IPv4 BGP session to exchange IPv4 prefixes and an IPv6 BGP session to exchange IPv6 prefixes. As the default is IPv4, for IPv6 BGP sessions you usually need to disable IPv4 and enable IPv6 (unless the defaults have been changed at some point, but you really don't want to depend on that):
! router bgp 65550 neighbor 2001:db8::2 remote-as 65551 ! address-family ipv4 no neighbor 2001:db8::2 activate ! address-family ipv6 neighbor 2001:db8::2 activate !
Or you can make a route map that sets the next hop address to an address that does work.
For iBGP, it's often easier to also use the IPv4 BGP sessions for IPv6, as the number of iBGP sessions adds up quickly and iBGP doesn't modify the next hop address, so the issue above doesn't come up.
However, there's an additional complication when mixing IPv4 and IPv6 in BGP: debugging gets much harder.
If you want to see what's happening with your BGP sessions, you can use the show bgp ipv4 unicast summary and show bgp ipv6 unicast summary commands:
# show bgp ipv4 unicast summary Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 22.214.171.124 4 81 23 24 0 0 0 00:20:28 16 2001:1c00:161d:df00::1 4 81 24 24 0 0 0 00:20:27 19
# show bgp ipv6 unicast summary Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 2001:1c00:161d:df00::1 4 81 26 26 0 0 0 00:22:01 1
So with these commands, we get to see the BGP sessions for which IPv4 or IPv6 is activated, regardless of whether the session runs over IPv4 or IPv6. So far, so good. And in later Cisco IOS versions, I believe this works the same for other show bgp commands. But under older IOS versions the IPv4 commands won't always take an IPv6 address and vice versa.
But at least under Cisco IOS, the commands now make a reasonable amount of sense: rather than show ip bgp ... for IPv4 and show bgp ... for IPv6, we can now use the much more consistent show bgp ipv4 unicast ... and show bgp ipv6 unicast ... commands.
Not so much under Quagga, though. At least, under version 0.99.22.4. The good news is that you can actually use show ip bgp neighbors <IPv6 address> and show bgp neighbors <IPv4 address>. The bad news is that even though Quagga understands the show bgp ipv4 unicast summary command, it doesn't understand the show bgp ipv4 unicast neighbors ... command. You have to use show ip bgp neighbors ... instead.
So the moral of the story is that you make life a lot easier if you don't mix IPv4 and IPv6 in BGP. If you do, it helps to use recent software, but make sure you check all the possible variations of the different commands, because they're not necessarily used consistently. Archives of all articles - RSS feed
My Books: "BGP" and "Running IPv6"On this page you can find more information about my book "BGP". Or you can jump immediately to chapter 6, "Traffic Engineering", (approx. 150kB) that O'Reilly has put online as a sample chapter. Information about the Japanese translation can be found here.
More information about my second book, "Running IPv6", is available here.
BGP SecurityBGP has some security holes. This sounds very bad, and of course it isn't good, but don't be overly alarmed. There are basically two problems: sessions can be hijacked, and it is possible to inject incorrect information into the BGP tables for someone who can either hijack a session or someone who has a legitimate BGP session.
Session hijacking is hard to do for someone who can't see the TCP sequence number for the TCP session the BGP protocol runs over, and if there are good anti-spoofing filters it is even impossible. And of course using the TCP MD5 password option (RFC 2385) makes all of this nearly impossible even for someone who can sniff the BGP traffic.
Nearly all ISPs filter BGP information from customers, so in most cases it isn't possible to successfully inject false information. However, filtering on peering sessions between ISPs isn't as widespread, although some networks do this. A rogue ISP could do some real damage here.
There are now two efforts underway to better secure BGP:
The IETF RPSEC (routing protocol security) working group is active in this area.
What is BGPexpert.com?BGPexpert.com is a website dedicated to Internet routing issues. What we want is for packets to find their way from one end of the globe to another, and make the jobs of the people that make this happen a little easier.
Ok, but what is BGP?Have a look at the "what is BGP" page. There is also a list of BGP and interdomain routing terms on this page.
BGP and MultihomingIf you are not an ISP, your main reason to be interested in BGP will probably be to multihome. By connecting to two or more ISPs at the same time, you are "multihomed" and you no longer have to depend on a single ISP for your network connectivity.
This sounds simple enough, but as always, there is a catch. For regular customers, it's the Internet Service Provider who makes sure the rest of the Internet knows where packets have to be sent to reach their customer. If you are multihomed, you can't let your ISP do this, because then you would have to depend on a single ISP again. This is where the BGP protocol comes in: this is the protocol used to carry this information from ISP to ISP. By announcing reachability information for your network to two ISPs, you can make sure everybody still knows how to reach you if one of those ISPs has an outage.
For those of you interested in multihoming in IPv6 (which is pretty much impossible at the moment), have a look at the "IPv6 multihoming solutions" page.
Are you a BGP expert? Take the test to find out!
These questions are somewhat Cisco-centric. We now also have another set of questions and answers for self-study purposes.
You are visiting bgpexpert.com over IPv4. Your address is 126.96.36.199.