Anycast DNS Lab
Goal of this lab is to originate your BGP prefix from both servers to have anycast.
We use FRR as the BGP speaker for the lab.
Install FRR by running following commands (instructions based on FRR’s documentation here)
# add GPG key
curl -s https://deb.frrouting.org/frr/keys.gpg | sudo tee /usr/share/keyrings/frrouting.gpg > /dev/null
# possible values for FRRVER: frr-6 frr-7 frr-8 frr-9.0 frr-9.1 frr-stable
# frr-stable will be the latest official stable release
FRRVER="frr-stable"
echo deb '[signed-by=/usr/share/keyrings/frrouting.gpg]' https://deb.frrouting.org/frr \
$(lsb_release -s -c) $FRRVER | sudo tee -a /etc/apt/sources.list.d/frr.list
# update and install FRR
sudo apt update && sudo apt install frr frr-pythontools -y
Edit /etc/frr/daemons
sudo vim /etc/frr/daemons
and
change bgpd=no to bgpd=yes
Save changed, and restart frr
sudo systemctl restart frr
Enter vtysh sell using command:
sudo vtysh
This gives Cisco ios like config style. Setup BGP session.
Lab’s router ASN: 64700
Identify your ASN and IP address for the session.
Server | Your ASN | Peer IP |
---|---|---|
a01 | 64601 | 172.16.1.1 |
a02 | 64602 | 172.16.2.1 |
a03 | 64603 | 172.16.3.1 |
a04 | 64604 | 172.16.4.1 |
a05 | 64605 | 172.16.5.1 |
a06 | 64606 | 172.16.6.1 |
a07 | 64607 | 172.16.7.1 |
a08 | 64608 | 172.16.8.1 |
a09 | 64609 | 172.16.9.1 |
a10 | 64610 | 172.16.10.1 |
a11 | 64611 | 172.16.11.1 |
a12 | 64612 | 172.16.12.1 |
a13 | 64613 | 172.16.13.1 |
a14 | 64614 | 172.16.14.1 |
a15 | 64615 | 172.16.15.1 |
a16 | 64616 | 172.16.16.1 |
a17 | 64617 | 172.16.17.1 |
a18 | 64618 | 172.16.18.1 |
a19 | 64619 | 172.16.19.1 |
a20 | 64620 | 172.16.20.1 |
a21 | 64621 | 172.16.21.1 |
a22 | 64622 | 172.16.22.1 |
a23 | 64623 | 172.16.23.1 |
a24 | 64624 | 172.16.24.1 |
a25 | 64625 | 172.16.25.1 |
a26 | 64626 | 172.16.26.1 |
a27 | 64627 | 172.16.27.1 |
a28 | 64628 | 172.16.28.1 |
a29 | 64629 | 172.16.29.1 |
a30 | 64630 | 172.16.30.1 |
b01 | 64601 | 172.17.1.1 |
b02 | 64602 | 172.17.2.1 |
b03 | 64603 | 172.17.3.1 |
b04 | 64604 | 172.17.4.1 |
b05 | 64605 | 172.17.5.1 |
b06 | 64606 | 172.17.6.1 |
b07 | 64607 | 172.17.7.1 |
b08 | 64608 | 172.17.8.1 |
b09 | 64609 | 172.17.9.1 |
b10 | 64610 | 172.17.10.1 |
b11 | 64611 | 172.17.11.1 |
b12 | 64612 | 172.17.12.1 |
b13 | 64613 | 172.17.13.1 |
b14 | 64614 | 172.17.14.1 |
b15 | 64615 | 172.17.15.1 |
b16 | 64616 | 172.17.16.1 |
b17 | 64617 | 172.17.17.1 |
b18 | 64618 | 172.17.18.1 |
b19 | 64619 | 172.17.19.1 |
b20 | 64620 | 172.17.20.1 |
b21 | 64621 | 172.17.21.1 |
b22 | 64622 | 172.17.22.1 |
b23 | 64623 | 172.17.23.1 |
b24 | 64624 | 172.17.24.1 |
b25 | 64625 | 172.17.25.1 |
b26 | 64626 | 172.17.26.1 |
b27 | 64627 | 172.17.27.1 |
b28 | 64628 | 172.17.28.1 |
b29 | 64629 | 172.17.29.1 |
b30 | 64630 | 172.17.30.1 |
Configure BGP session on your primary and secondary with the router.learnsdns.info. Read the neighbor IP from the table above and change it. It is different for primary and secondary.
conf t
ip route 10.11.1.0/24 Null0
router bgp 64601
neighbor 172.16.1.1 remote-as 64700
no bgp ebgp-requires-policy
network 10.11.1.0/24
end
wr
Next, verify that BGP session is up and you are announcing required pool
sh ip bgp neighbors 172.16.1.1 advertised-routes
Example output:
a01# sh ip bgp neighbors 172.16.1.1 advertised-routes
BGP table version is 1, local router ID is 192.168.1.1, vrf id 0
Default local pref 100, local AS 64601
Status codes: s suppressed, d damped, h history, * 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
*> 10.11.1.0/24 0.0.0.0 0 32768 i
Total number of prefixes 1
a01#