iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
6️⃣

A Junior High School Student Tries BGP IPv6 Route Exchange (Also Wanted to Prevent BGP Hijacking)

に公開

Introduction

In my previous article, I performed IPv4 route exchange using BGP (Border Gateway Protocol).
Since then, I've gotten a bit hooked on the world of BGP, and this time I finally took on the challenge of IPv6 route exchange.

What I'll Do This Time

This time, I'll experience BGP route exchange with IPv6.

Last time, I set up a BGP peering between two containers in an IPv4-only environment and exchanged routes.
But in the real internet, IPv6 is already commonly used.
In other words, to say "I truly understand BGP," I need to try route exchange with IPv6 as well.

What I'll do is simple:

  1. Create a similar environment to the previous containers on ProxmoxVE (Ubuntu Server).
  2. Assign IPv6 addresses to each to create a dual-stack environment.
  3. Configure IPv6 BGP peering with FRRouting (FRR).
  4. Verify that IPv6 routes can actually be exchanged.

Environment Setup

First, create the containers that will act as ASes as regular internet-connected containers.
The version of the containers for this test is as follows:

root@BGPv6:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 25.04
Release:        25.04
Codename:       plucky
root@BGPv6:~#

Then, execute the following command to install FRRouting.

apt update && apt install frr

After installation, switch the interface to vmbr2 and configure the IP addresses as follows.

AS65001:

AS65002:

Setting IPv6 Addresses

To run BGP over IPv6, two types of addresses are needed:

  1. An address to communicate with the neighboring BGP router (for peering).
  2. An address to register as an advertised (announced) route (for loopback).
    The former acts as the "BGP communication channel," while the latter serves as the "address to announce to the world via BGP."

In this experiment, I used the following configuration:

Purpose Interface BGP1 BGP2
Connection between BGP peers eth0 fd00::2/64 fd00::3/64
Own network to advertise (announce) lo (loopback) 2001:db8:1::1/64 2001:db8:2::1/64

Based on this, I configure each container as follows.

AS65001:

ip -6 addr add 2001:db8:1::1/64 dev lo

AS65002:

ip -6 addr add 2001:db8:2::1/64 dev lo

Writing the FRR Configuration File

First, write the settings to start bgpd. The configuration file location is /etc/frr/daemons.

bgpd=no

Change it to:

bgpd=yes

The configuration file location is /etc/frr/frr.conf.

AS65001:

router bgp 65001
 bgp router-id 10.10.10.2
 neighbor fd00::3 remote-as 65002

 address-family ipv6 unicast
  network 2001:db8:1::/64
  neighbor fd00::3 activate
  no bgp ebgp-requires-policy
 exit-address-family

AS65002:

router bgp 65002
 bgp router-id 10.10.10.3
 neighbor fd00::2 remote-as 65001

 address-family ipv6 unicast
  network 2001:db8:2::/64
  neighbor fd00::2 activate
  no bgp ebgp-requires-policy
 exit-address-family

After configuration, restart with systemctl restart frr.

Checking the Peering

Check on each container by starting vtysh.

root@BGPv6:~# vtysh

Hello, this is FRRouting (version 10.2.1).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

BGPv6# show bgp ipv6 summary

IPv6 Unicast Summary:
BGP router identifier 10.10.10.2, local AS number 65001 VRF default vrf-id 0
BGP table version 2
RIB entries 3, using 384 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
fd00::3         4      65002         6         6        2    0    0 00:00:34            1        2 N/A

Total number of neighbors 1
BGPv6# show bgp ipv6
BGP table version is 2, local router ID is 10.10.10.2, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  2001:db8:1::/64  ::                       0         32768 i
 *>  2001:db8:2::/64  fe80::be24:11ff:fe7e:7e16
                                             0             0 65002 i

Displayed 2 routes and 2 total paths
BGPv6# 

It was displayed, and the route exchange succeeded!!

Finally

This time, I tried IPv6 route exchange with BGP.
The configuration was a bit more complex than IPv4, but the moment the peer was established and routes started flowing was truly thrilling.

I actually wanted to try BGP hijacking countermeasures with RPKI, but there was too little information available online, so I postponed it this time.
However, I feel ready to take on the next challenge now that I understand the mechanism.

Thank you for reading this far. Please give it a Like as well.

Discussion