Tutorial based on Ubuntu 24.04 LTS
Please make sure that you have completed the AnycastIP setup - internal communication
Open our control panel and navigate to the Networks list or use this link. Click the Addresses tab to list all the anycast IP addresses.
Create a new netplan configuration file /etc/netplan/99-dummy.yaml and add your anycast IP addresses.
network:
version: 2
renderer: networkd
dummy-devices:
dummy0:
addresses:
- 185.187.152.40/32
- 2a05:b0c4:1::e/128
routing-policy:
- from: 185.187.152.40/32
table: 1
priority: 500
- from: 2a05:b0c4:1::e/128
table: 1
priority: 500
After saving the file, update the permissions by running:
sudo chmod 600 /etc/netplan/99-dummy.yaml
Apply the new configuration by running:
sudo netplan generate
sudo netplan apply
Since you will be announcing IP addresses outside your provider's scope, you need to configure egress routing. Netplan does not fully support configuring certain types of routes, but we can fix this by using networkd-dispatcher.
Update the package list by running the following command.
sudo apt-get update
Install the networkd-dispatcher package by running the following command.
sudo apt-get install networkd-dispatcher
Once installed, we need to create two scripts. One will be responsible for adding the routing rules when our dummy interface is up, and the other will remove them when the interface goes down.
Create file /etc/networkd-dispatcher/routable.d/99-dummy-up.sh with following content:
#!/bin/bash
if [ "$IFACE" == "dummy0" ]; then
# IPv4 routers in London, UK, note the metric increase
ip -4 route add default via 172.31.255.123 table 1 metric 100
ip -4 route add default via 172.31.255.133 table 1 metric 110
# IPv6 routers in London, UK, note the metric increase
ip -6 route add default via fd00:dead:c0de:cafe:172:31:255:123 table 1 metric 100
ip -6 route add default via fd00:dead:c0de:cafe:172:31:255:123 table 1 metric 110
fi
You must set execute permissions on the script so the dispatcher can run it:
sudo chmod +x /etc/networkd-dispatcher/routable.d/99-dummy-up.sh
Create file /etc/networkd-dispatcher/off.d/99-dummy-down.sh with following content:
#!/bin/bash
if [ "$IFACE" == "dummy0" ]; then
# IPv4 routers in London, UK, note the metric increase
ip -4 route del default via 172.31.255.123 table 1 metric 100
ip -4 route del default via 172.31.255.133 table 1 metric 110
# IPv6 routers in London, UK, note the metric increase
ip -6 route del default via fd00:dead:c0de:cafe:172:31:255:123 table 1 metric 100
ip -6 route del default via fd00:dead:c0de:cafe:172:31:255:123 table 1 metric 110
fi
You must set execute permissions on the script so the dispatcher can run it:
sudo chmod +x /etc/networkd-dispatcher/off.d/99-dummy-down.sh
Once done, restart the networkd-dispatcher service by running:
sudo systemctl restart networkd-dispatcher
Let's verify that the interface dummy0 was configured correctly by running:
ip addr show dummy0
The expected output should present our anycast IP addresses:
5: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
link/ether 0e:98:93:55:e8:5d brd ff:ff:ff:ff:ff:ff
inet 185.187.152.40/32 scope global dummy0
valid_lft forever preferred_lft forever
inet6 2a05:b0c4:1::e/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::c98:93ff:fe55:e85d/64 scope link
valid_lft forever preferred_lft forever
Now, let's check the egress routing by running for IPv4:
ip -4 route show table 1
As expected, we can see the two default routes:
default via 172.31.255.123 dev zt0 metric 100
default via 172.31.255.133 dev zt0 metric 110
Let's do the same for IPv6 by running:
ip -6 route show table 1
Again, we can see the two expected default routes:
default via fd00:dead:c0de:cafe:172:31:255:123 dev zt0 metric 100 pref medium
default via fd00:dead:c0de:cafe:172:31:255:123 dev zt0 metric 110 pref medium
The last element we need to check is the egress routing rules. Let's check the IPv4:
ip -4 rule show table 1
The output should list our IPv4 anycast address:
500: from 185.187.152.40 lookup 1 proto static
We need to do the same for IPv6 by running:
ip -6 rule show table 1
The output should list our IPv6 anycast address:
500: from 2a05:b0c4:1::e lookup 1 proto static
Our network configuration is now completed, and we can move to the BGP setup.
Continue to the next step - AnycastIP setup - BGP with BIRD or AnycastIP setup - BGP with FRR