Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| bgp-extended-nexthop | FRR, BIRD3 |
| bgp-frr-unnumbered | FRR | <!-- Add BIRD when unnumbered peerings are supported -->
| bgp-frr-vpn-route-leak | FRR |
| bgp-frr-srv6 | FRR, (GoBGP) |
| bgp-md5 | FRR, BIRD3 |
| bgp-prefsource | FRR, BIRD3 |
| bgp-simple | FRR, BIRD3, GoBGP |
Expand Down
59 changes: 59 additions & 0 deletions tests/bgp-frr-srv6/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# bgp-frr-srv6

This integration test implements a basic service-provider topology to test IPv6 Segment Routing (SRv6) behavior end-to-end.

The provider network consists of four routers (P1, PE1, PE2, and PE3) and uses only ipv6. Customers A and B are connected to the provider through customer-edge routers: CE1 and CE2 for customer A, and CE3 and CE4 for customer B. In this setup, CE1 and CE3 connect into PE1, while CE2 connects into PE2, and CE4 connects into PE3.

```mermaid
flowchart LR
CE1["CE1
(A)"]
CE2["CE2
(A)"]
CE3["CE3
(B)"]
CE4["CE4
(B)"]

CE3 --20--- PE1
CE1 --10--- PE1
PE1 --3--- P1
P1 --4--- PE2 --11--- CE2
P1 --5--- PE3 --21--- CE4
PE2 --6--- PE1
```

## Addresses

| System | IPv4 | IPv6 |
|--------|-------------------------|-------------------------------|
| P1 | | |
| PE1 | | 2001:db8:1::/48 (lo: :ffff::1)|
| PE2 | | 2001:db8:2::/48 (lo: :ffff::1)|
| PE3 | | 2001:db8:3::/48 (lo: :ffff::1)|
| CE1 | 10.10.1.0/24 (lo: .100) | 3fff:aaaa:1::/48 (lo: ::100) |
| CE2 | 10.10.2.0/24 (lo: .100) | 3fff:aaaa:2::/48 (lo: ::100) |
| CE3 | 10.20.1.0/24 (lo: .100) | 3fff:bbbb:1::/48 (lo: ::100) |
| CE4 | 10.20.2.0/24 (lo: .100) | 3fff:bbbb:2::/48 (lo: ::100) |


## Software Selection
| System | Network Implementation | Routing Daemon |
|--------|---------------------------|------------------|
| P1 | legacy networking options | FRR (isisd) |
| PE1 | legacy networking options | FRR (isisd,bgpd) |
| PE2 | systemd-network | FRR (isisd,bgpd)*|
| PE3 | ifstate | FRR (isisd,bgpd) |
| CE1 | systemd-network | FRR (bgpd) |
| CE2 | legacy networking options | BIRD |
| CE3 | legacy networking options | FRR (bgpd) |
| CE4 | ifstate | FRR (bgpd) |

\* GoBGP planned

## Resources
This test was only possible because of these blog posts:
- https://onvox.net/2022/06/27/srv6-frr/
- https://onvox.net/2024/02/01/srv6-vyos/
- https://onvox.net/2024/12/16/srv6-frr/
- https://onvox.net/2024/12/26/srv6-vyos-revisit/
66 changes: 66 additions & 0 deletions tests/bgp-frr-srv6/ce1.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
virtualisation.interfaces.eth1 = {
vlan = 10;
assignIP = false;
};
systemd.network = {
enable = true;
networks = {
"10-lo" = {
matchConfig.Name = "lo";
address = [
"10.10.1.100/32"
"3fff:aaaa:1::100/128"
];
};
"20-eth1" = {
matchConfig.Name = "eth1";
address = [
"192.0.2.129/30"
"2001:db8:10:128::1/64"
];
};
};
};
services.frr = {
bgpd.enable = true;
config = ''
route-map set-src permit 10
set src 10.10.1.100
exit

route-map set-src-6 permit 10
set src 3fff:aaaa:1::100
exit

ip protocol bgp route-map set-src
ipv6 protocol bgp route-map set-src-6

ip route 10.10.1.0/24 reject
ipv6 route 3fff:aaaa:1::/48 reject

router bgp 65001
no bgp ebgp-requires-policy
no bgp reject-as-sets
no bgp default ipv4-unicast
no bgp network import-check
neighbor 192.0.2.130 remote-as 65000
no neighbor 192.0.2.130 enforce-first-as
neighbor 2001:db8:10:128::2 remote-as 65000
no neighbor 2001:db8:10:128::2 enforce-first-as

address-family ipv4 unicast
network 10.10.1.0/24
neighbor 192.0.2.130 activate
neighbor 192.0.2.130 soft-reconfiguration inbound
exit-address-family

address-family ipv6 unicast
network 3fff:aaaa:1::/48
neighbor 2001:db8:10:128::2 activate
neighbor 2001:db8:10:128::2 soft-reconfiguration inbound
exit-address-family
exit
'';
};
}
97 changes: 97 additions & 0 deletions tests/bgp-frr-srv6/ce2.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
virtualisation.interfaces.eth1 = {
vlan = 11;
assignIP = false;
};
networking.interfaces = {
lo = {
ipv4.addresses = [
{
address = "10.10.2.100";
prefixLength = 32;
}
];
ipv6.addresses = [
{
address = "3fff:aaaa:2::100";
prefixLength = 128;
}
];
};
eth1 = {
ipv4.addresses = [
{
address = "192.0.2.133";
prefixLength = 30;
}
];
ipv6.addresses = [
{
address = "2001:db8:10:132::1";
prefixLength = 64;
}
];
};
};
services.bird = {
enable = true;
config = ''
log syslog all;
router id 10.10.2.100;

protocol device {
scan time 10;
}

protocol kernel kernel4 {
ipv4 {
import none;
export filter {
krt_prefsrc = 10.10.2.100;
accept;
};
};
}
protocol kernel kernel6 {
ipv6 {
import none;
export filter {
krt_prefsrc = 3fff:aaaa:2::100;
accept;
};
};
}

protocol static static4 {
ipv4;

route 10.10.2.0/24 unreachable;
}
protocol static static6 {
ipv6;

route 3fff:aaaa:2::/48 unreachable;
}

protocol bgp pe2_v4 {
local as 65002;
neighbor 192.0.2.134 as 65000;

ipv4 {
import all;
export all;
};
}

protocol bgp pe2_v6 {
local as 65002;
neighbor 2001:db8:10:132::2 as 65000;

ipv6 {
import all;
export all;
};
}
'';
};
}
54 changes: 54 additions & 0 deletions tests/bgp-frr-srv6/ce3.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
virtualisation.interfaces.eth1 = {
vlan = 20;
assignIP = false;
};
networking = {
interfaces = {
lo = {
ipv4.addresses = [
{
address = "10.20.1.100";
prefixLength = 32;
}
];
ipv6.addresses = [
{
address = "3fff:bbbb:1::100";
prefixLength = 128;
}
];
};
eth1 = { }; # set interface up
};
};
services.frr = {
bgpd.enable = true;
config = ''
ip route 10.20.1.0/24 reject
ipv6 route 3fff:bbbb:1::/48 reject

router bgp 65003
no bgp ebgp-requires-policy
no bgp reject-as-sets
no bgp default ipv4-unicast
no bgp network import-check
neighbor eth1 interface remote-as 65000
no neighbor eth1 enforce-first-as
no neighbor eth1 capability link-local

address-family ipv4 unicast
network 10.20.1.0/24
neighbor eth1 activate
neighbor eth1 soft-reconfiguration inbound
exit-address-family

address-family ipv6 unicast
network 3fff:bbbb:1::/48
neighbor eth1 activate
neighbor eth1 soft-reconfiguration inbound
exit-address-family
exit
'';
};
}
65 changes: 65 additions & 0 deletions tests/bgp-frr-srv6/ce4.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
virtualisation.interfaces.eth1 = {
vlan = 21;
assignIP = false;
};
networking = {
ifstate = {
enable = true;
settings = {
parameters.ignore.ifname = [
"eth0"
];
interfaces = {
eth1.link = {
state = "up";
kind = "physical";
};
loopback = {
addresses = [
"10.20.2.100/32"
"3fff:bbbb:2::100/128"
];
link = {
state = "up";
kind = "dummy";
};
};
};
sysctl.all = {
ipv4.forwarding = 1;
ipv6.forwarding = 1;
};
};
};
};
services.frr = {
bgpd.enable = true;
config = ''
ip route 10.20.2.0/24 reject
ipv6 route 3fff:bbbb:2::/48 reject

router bgp 65004
no bgp ebgp-requires-policy
no bgp reject-as-sets
no bgp default ipv4-unicast
no bgp network import-check
neighbor eth1 interface remote-as 65000
no neighbor eth1 enforce-first-as
no neighbor eth1 capability link-local

address-family ipv4 unicast
network 10.20.2.0/24
neighbor eth1 activate
neighbor eth1 soft-reconfiguration inbound
exit-address-family

address-family ipv6 unicast
network 3fff:bbbb:2::/48
neighbor eth1 activate
neighbor eth1 soft-reconfiguration inbound
exit-address-family
exit
'';
};
}
Loading
Loading