Now that we have successfully announced our ASN, it is time to do some multihoming and connect to an Internet Exchange.
An Internet Exchange Point (IXP) is basically a big Ethernet switch that allows people with an ASN just like you to peer with each other via BGP.
Benefits of connecting to IXPs:
- You can easily have more upstream; by having more upstream, your ASN will stop running afoul of RIPE’s requirement to be multihomed in order to have an ASN.
- You are not bound to terms on your upstream. For example, if your upstream limits your data usage and you have a server connected to the same IXP you wish to transfer data to/from, then all bandwidth usage inside the IXP is not counted on your upstream.
Finding an IXP to join
The IXP you can join is limited to what your provider can provide. Since my BGP VPS is in iFog, for this tutorial, I will join FogIXP.
Joining an IXP
Before joining an IXP, run ip link show
first. This will list all of your current interfaces, so you can easily know later what interface is added later on when you have joined an IXP.
Joining an IXP can either be done using your VPS provider’s panel, by opening a support ticket, or on IXP’s website.
After the IXP granted you membership, they will send you your IXP Manager credentials via email or via ticket.
Login to your IXP’s IXP Manager and you will get your own peering IPv6 address and the route server’s IPv6 address.
Run ip link show
again, and then you will see a new interface has been added to your VPS. In my case and for this tutorial, it is ens19
.
Set up IXP on your VPS
- Create an interface configuration for that recently added interface.
sudo nano /etc/network/interfaces.d/<Interface name>
For example: sudo nano /etc/network/interfaces.d/ens19
- Paste this configuration and edit.
|
|
Here is an example config with my interface and my IPv6 address from FogIXP.
|
|
- Reload the interface so we get rid of the autoconfigured IPv6 address and apply our assigned IPv6 address.
|
|
- Run
ip -6 addr
to make sure that your assigned IPv6 address is assigned to the interface.
Set up BGP session
Moving to full table config
If you followed my tutorial on how we set up our first BGP session, take note that we used a default route config by not exporting the routes to the kernel. Now that we are going to have multiple peers, it is time to do a full table config.
Take note that this will consume more RAM, so it is much better if you set up a swap space first just in case.
- Comment out or remove this lines in order for BIRD to export the routes to the kernel.
|
|
As BIRD will now export the route to the kernel, every route should have a source IP. Remember what we did last time by setting the source IP to the default route?
This will be the equivalent to that but instead of setting the source IP to the default route, BIRD will set the source IP on every route to be exported into the kernel.
- Add a source6 by specifying your IPv6 address assigned to your dummy1.
|
|
Example with my announced IPv6 address:
|
|
Set up a BGP session with a route server
A route server is where all of the members connected to the IXP exchange routes with each other, since creating a BGP session for every member to you is basically not so scalable.
And so that you don’t need to email every member of the IXP to exchange routes with you.
- Add a route server template to your Pathvector config.
|
|
Example with my ASN:
|
|
- Add the route server to your peer list. You can specify all the route server’s IP addresses on neighbors.
|
|
Example with FogIXP’s route servers:
|
|
Set up a BGP session with peers
If you contacted someone on the IXP and they wanted to peer with you, you can establish a direct BGP session with both of you, bypassing the route servers.
Install bgpq4.
sudo apt install bgpq4
Add a peer template to your Pathvector config.
|
|
Example with my ASN:
|
|
- Add the peer to your peer list.
|
|
Example with my peers AS200879 and AS199676 on FogIXP:
|
|
Establish the BGP sessions
Combining all of those, this will be the resulting Pathvector config:
|
|
- Generate BIRD2 config from Pathvector.
sudo pathvector generate
- Check the BGP session. If you see “Established”, then the BGP session is working.
sudo birdc show protocol
Example output:
|
|
- Check the status of your prefix to see if it is being exported/announced to your peers.
sudo birdc show route export <BGP session name> all
Example:sudo birdc show route export FOGIXP_AS47498_v6 all
Example output:
|
|
- If you are also a member of FogIXP, you can check my prefix if it goes to the route server than your upstream. The highest route is the preferred route.
sudo birdc show route 2a0f:85c1:3b2::/48