Community discussions

MikroTik App
 
jmay
Member
Member
Topic Author
Posts: 336
Joined: Tue Jun 23, 2009 8:26 pm

IPv6, BGP, and Aggregates

Wed Jul 19, 2017 5:51 pm

Should I be able to advertise IPv6 space via aggregates because it doesn't appear to work. I have multiple upstream providers and would like to use OSPF to advertise routes via one fiber or another, but it doesnt alter the advertisement. My provider appears to be accepting /64 advertisements which will work fine, but seems like a messy way to do this and I wonder how long it will take before they stop allowing that.
 
User avatar
acruhl
Member
Member
Posts: 371
Joined: Fri Jul 03, 2015 7:22 pm

Re: IPv6, BGP, and Aggregates

Wed Jul 19, 2017 10:10 pm

You should probably post this in the forwarding protocols section.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: IPv6, BGP, and Aggregates

Thu Jul 20, 2017 12:44 am

I'm not sure that I completely understand your problem.

It sounds like you're trying to affect ingress routing policy based on IPv6 prefix.
This essentially works the same as it does in IPv4 - and FYI, the general concensus for longest globally-routed prefix is /48 (meaning /49 - /128 aren't going to make it everywhere in the global IPv6 routing table)

Substitute your real IPv6 prefix with 2001:db8 and give real examples of the prefixes you're trying to announce. It would help tremendously to have some more concrete info to work on.

(so if your real IPv6 prefix were 41cf:9ac4:c000::/40 you should post it here as 2001:db8:c000::/40)

Some BGP basics to keep in mind:
- For each prefix that you wish to originate into BGP (ip4 or ip6 doesn't matter), you must have one network statement for exactly that prefix.
- That prefix must exist as an active route in the router's ipv6 routing table (assuming that you've not disabled synchronization - which is a bad habit for eBGP routers)

Suppose you had configured network 2001:db8:1234::/48 in your BGP....
Suppose further that you have 2001:db8:1234:aa00::/56 active in your routing table. This prefix would NOT be originated into BGP by your router because there is no such prefix configured.
Let's also say that there is no route in your routing table for 2001:db8:1234::/48 - your router would not originate this prefix even with the network statement in place because there is no active route in the routing table.
Final detail - if some other router within your own ASN (an iBGP neighbor) is actually originating some prefix, then that prefix WILL be passed to all eBGP neighbors unless blocked by a filter or if that eBGP neighbor is giving you a better path than the one in iBGP)

If you're announcing /64 prefixes - then I assume you're either adding those as networks, or else you're redistributing connected or static routes into BGP (you really should never redistribute routes into the global BGP table - you should properly originate them with network statement + reachability)

Hope some of these general-purpose thoughts about BGP help you get to the bottom of things. Otherwise, feel free to post some more specific info and the forums community should give you some insights.
 
jmay
Member
Member
Topic Author
Posts: 336
Joined: Tue Jun 23, 2009 8:26 pm

Re: IPv6, BGP, and Aggregates

Fri Jul 21, 2017 5:25 pm

For simplicity sake, lets say my bgp router is connected to a 2nd router via ospv3. 2nd router has been given a /48, we'll say 2001:1111:1::/48. 2nd router uses that pool to assign /64's to customers. Actually I'm now issuing /60's. I set 2nd router to distribute connected and static routes as type 1.

Now on the BGP router if I set BGP to redistribute OSPF I end up advertising all the /60's that customers have received. If I put 2001:1111:1::/48 as an aggregate it does not advertise all that group as a /48. You got my thinking. Since the /48 is just a pool I don't have a network statement anywhere showing that /48. So how do I do that if I am using it as a pool?
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: IPv6, BGP, and Aggregates

Fri Jul 21, 2017 9:43 pm

This is best practice anyway, even w/o dynamic routing:

On the router with the pool, create a static route type=unreachable with the /48. This is so that traffic bound for unassigned addresses within that pool should get sinkholed at the pool router. Since the pool is routed to this one router, it's safe to assume that if this router has no route for any given address, that address must not exist, ergo it should be discarded.
/ipv6 route add dst=2001:db8:cafe::/48 type=unreachable
This also integrates quite nicely with dynamic routing:

Configure the pool router to redistribute static routes into OSPF. This will originate the /48 prefix into OSPF for you, which will trigger BGP to originate the /48 into BGP.
For extra benefit, you can set up a filter for ospf-out on the pool router which drops sub-prefixes of the /48 so that you only have the one prefix in your OSPF table.
e.g.:
/routing rule
add chain=My-ospf-Filter prefix=2001:db8:cafe::/48 prefix-length=49-128 action=discard
add chain=My-ospf-Filter action=accept
 
jmay
Member
Member
Topic Author
Posts: 336
Joined: Tue Jun 23, 2009 8:26 pm

Re: IPv6, BGP, and Aggregates

Mon Jul 24, 2017 6:17 pm

THANK YOU THANK YOU THANK YOU!!! This makes sense and it works! I see how to do this with IPv4 now as well. This is exactly the info I needed. If you ever end up in New Mexico let me know and I'll buy you a beer!
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: IPv6, BGP, and Aggregates

Mon Jul 24, 2017 6:39 pm

THANK YOU THANK YOU THANK YOU!!! This makes sense and it works! I see how to do this with IPv4 now as well. This is exactly the info I needed. If you ever end up in New Mexico let me know and I'll buy you a beer!
No problem. Glad to see that you've realized that the same practice / theory applies to both IPv4 and IPv6 routing. At that level, there's really no difference in the two protocols. It's just prefix length / routing protocol preferences / AD's / metrics / etc.

Happy routing!

EDIT: Oh, one more thing - I'd recommend that you not be redistributing OSPF into BGP on the core router. Just specify network=xxxxxx for each prefix that you wish to advertise, and make sure they're in OSPF so that BGP will see them active and hoist the flag (I think of BGP like a flag pole that whenever something's reachable locally, BGP sends a flag up the pole so the rest of the Internet can see it).
 
jmay
Member
Member
Topic Author
Posts: 336
Joined: Tue Jun 23, 2009 8:26 pm

Re: IPv6, BGP, and Aggregates

Mon Jul 24, 2017 7:11 pm

The reason I'm trying to inject OSPF into BGP is we have 3 core routers in 3 different towns. Each town will have a dedicated direction to reach the internet, but I'd like the towns to switch to another town in the event of a problem considering all our towns are interlinked via wireless. In the past I've had to log into core routers and change bgp advertisements when I needed this to happen, this should allow automatic switch over for me.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: IPv6, BGP, and Aggregates

Tue Jul 25, 2017 5:13 pm

Not necessary.

Anything you can redistribute into BGP, you can originate with a network prefix in BGP router configuration. The difference is that BGP treats externally-sourced routes differently than it treats natively-originated prefixes - less so than IGPs like OSPF / EIGRP do, but still different. Furthermore, you can potentially create routing loops when you redistribute routes too much.

I did exactly what you're doing at my last job. We had two sites with each having its own /24, both coming from the same /23 block.
Site A advertised the A/24 and the B/24 with 4x AS-prepend so that the traffic for site B only coming to site A if site B's Internet connection drops.
(vice-versa at site B)
I used OSPF as the internal reachability determination, but I did not redistribute OSPF into BGP.
I simply put two network statements in each site's routers, and used a route-map to prepend prefix B at site A when making announcements to ISP-A.
(We used Cisco, but the concept is the same in ROS)

The only general situation I'm personally aware of where it is common practice to redistribute routes into BGP is on the provider/customer interface of MPLS L3VPN service. This is because the number of PE routers (customer-facing) can be quite large, and it is not scalable to configure network statements every time a customer makes changes in their topology.

To understand the difference in how BGP views a redistributed route vs. an originated route based on the presence of that prefix in an IGP, here's an analogy.

Suppose there is a valley with lots of lakes and streams in it. To help fishermen know the best fishing spots for different kinds of fish, the park rangers go out in boats with flags. Let's say a red flag means "trout" - any park ranger looking down in the water who sees trout will raise the red flag over his boat. If you were on the hill coming into the valley to go fishing, you could look out over the valley and see the red flags everywhere. These are the places to go if you want to catch trout. A red flag means that the ranger currently sees trout at that very spot, so you know those are the best places to go fishing for trout.

Now let's say a red/white striped flag means "I know where to find trout based on word of mouth"
A ranger may go plant a red/white flag in a place where he has heard from fishermen today that there are trout, but he has not personally observed any.
Coming over the hillside, would you go fishing by the red flags or the red/white striped flags?

Redistributed routes mean "I heard that you can go this way to get to such-and-such destination"
Originated routes mean "I see this destination personally."
As such - redistributed routes are secondary to native routes - and this is true of all routing protocols I'm aware of except maybe RIP (I'm not that experienced with RIP).

Who is online

Users browsing this forum: andreacar, f008600, fibracapi, GoogleOther [Bot], mickeymouse690 and 79 guests