🐦🔥 Using BIRD
About 371 words
The following complete walkthrough creates two Ubuntu VMs in Multipass and uses BIRD to exchange routes over BGP:
1. Create Two Virtual Machines
multipass launch --name vm1 --cpus 1 --mem 1G --disk 5G
multipass launch --name vm2 --cpus 1 --mem 1G --disk 5G2. Install BIRD
Install BIRD, the BGP routing daemon, on both VMs:
# Enter vm1
multipass shell vm1
sudo apt update
sudo apt install -y birdRepeat the same steps on vm2.
3. Configure BGP
Configure BIRD on vm1 (AS 65001)
Edit /etc/bird/bird.conf:
sudo nano /etc/bird/bird.confUse the following contents:
router id 192.168.64.100; # Use vm1's IP
protocol kernel {
scan time 60;
import filter {
if (net = 0.0.0.0/0) then reject;
accept;
};
export all;
}
protocol device {
scan time 60;
}
protocol bgp vm2 {
local as 65001;
neighbor 192.168.64.101 as 65002; # vm2's IP and AS
import all;
export all;
}Configure BIRD on vm2 (AS 65002)
Edit /etc/bird/bird.conf:
router id 192.168.64.101; # Use vm2's IP
protocol kernel {
scan time 60;
import filter {
if (net = 0.0.0.0/0) then reject;
accept;
};
export all;
}
protocol device {
scan time 60;
}
protocol bgp vm1 {
local as 65002;
neighbor 192.168.64.100 as 65001; # vm1's IP and AS
import all;
export all;
}4. Start BIRD and Verify
Restart BIRD on Both VMs:
sudo systemctl restart bird
sudo systemctl enable birdCheck BGP Neighbor Status:
birdc show protocolsThe output should show vm2 or vm1 in the Established state.
Test Connectivity:
Add a test route on vm1 and check whether vm2 learns it:
# Add a test route on vm1
sudo ip route add 10.0.0.0/24 via 192.168.64.100
# Check the routing table on vm2
ip route | grep 10.0.0.05. Troubleshoot Common Problems
- BGP neighbor does not establish a session:
Check that the firewall allows the BGP port (TCP 179):sudo ufw allow 179/tcp - Routes do not synchronize:
Ensureexport allis configured inprotocol kernel.
Result Diagram
vm1 (AS65001) ↔ BGP ↔ vm2 (AS65002)
192.168.64.100 192.168.64.101With this configuration, the two VMs exchange routing information dynamically over BGP. You can extend the experiment by adding OSPF or more neighbors.
You can also refer directly to the official Docker demonstration: https://packetfire.org/post/intro-to-bgp/