SANOG 41 DNS workshop
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Anycast DNS Lab

Goal of this lab is to originate your BGP prefix from both servers to have anycast.

Step 1: Install FRR

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 | 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
echo deb '[signed-by=/usr/share/keyrings/frrouting.gpg]' \
     $(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

Step 2: Configure FRR

Edit /etc/frr/daemons

sudo vim /etc/frr/daemons


change bgpd=no to bgpd=yes

Save changed, and restart frr

sudo systemctl restart frr

Step 3: Setup BGP session

Enter vtysh sell using command:

sudo vtysh 

This gives Cisco ios like config style. Setup BGP session.

BGP Session details:

Lab’s router ASN: 64700

Identify your ASN and IP address for the session.

Server Your ASN Peer IP
a01 64601
a02 64602
a03 64603
a04 64604
a05 64605
a06 64606
a07 64607
a08 64608
a09 64609
a10 64610
a11 64611
a12 64612
a13 64613
a14 64614
a15 64615
a16 64616
a17 64617
a18 64618
a19 64619
a20 64620
a21 64621
a22 64622
a23 64623
a24 64624
a25 64625
a26 64626
a27 64627
a28 64628
a29 64629
a30 64630
b01 64601
b02 64602
b03 64603
b04 64604
b05 64605
b06 64606
b07 64607
b08 64608
b09 64609
b10 64610
b11 64611
b12 64612
b13 64613
b14 64614
b15 64615
b16 64616
b17 64617
b18 64618
b19 64619
b20 64620
b21 64621
b22 64622
b23 64623
b24 64624
b25 64625
b26 64626
b27 64627
b28 64628
b29 64629
b30 64630

Configure BGP session on your primary and secondary with the Read the neighbor IP from the table above and change it. It is different for primary and secondary.

conf t
ip route Null0
router bgp 64601
neighbor remote-as 64700
no bgp ebgp-requires-policy

Step 3: Verify BGP announcement

Next, verify that BGP session is up and you are announcing required pool

sh ip bgp neighbors advertised-routes

Example output:

a01# sh ip bgp neighbors advertised-routes
BGP table version is 1, local router ID is, 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
 *>                  0         32768 i

Total number of prefixes 1