Difference between revisions of "BIRD"

From SOWNWiki
Jump to: navigation, search
(Installing on 18.04)
(Fixed name of server BIRD is on.)
Line 1: Line 1:
|servers=[[installed on::sown-gw]],  [[installed on::sown-gw2]], [[installed on::vpn]]
|servers=[[installed on::sown-gw]],  [[installed on::sown-gw2]], [[installed on::sown-vpn]]

Revision as of 23:39, 18 December 2019

Installed on sown-gw, sown-gw2, sown-vpn
Was installed on
Website https://bird.network.cz/

BIRD is a routing daemon that supports a number of protocols. In SOWN, we're using BIRD for OSPF between VPN servers and routers.


The BIRD documentation is very thorough and explains this in much better detail. Essentially, BIRD has a number of "protocols", each of which is attached to a routing table inside BIRD. Each protocol can "import" routes from the outside, and "export" routes to the outside, with filters for what goes in each direction.

Filters are written in BIRD's own DSL, and explained thoroughly in BIRD's documentation. It's a fairly complete language that makes a lot of manipulation easy. No more route-maps!

In SOWN we use the following protocols:

  • kernel - for adding routes into the kernel's routing table, and for learning routes added via VPN interfaces
  • OSPF - an IGP used within SOWN for carrying internal routes between hosts
  • Static - for static routes, will be used for routed /32s
  • direct - for importing on-link routes on VPN tap interfaces

Installing on 18.04

You'll need init-system-helpers from bionic-backports to install the bird2 package:

add-apt-repository ppa:cz.nic-labs/bird
apt install -t bionic-backports init-system-helpers
apt install bird2

bird2 will be included directly in 20.04, so no need for the PPA or backports then.


Unlike Quagga, BIRD has a separate configuration file and CLI. Therefore, all changes should be done through editing the configuration, but you can look at the current state of things using its CLI.

BIRD's base configuration lives in /etc/bird/bird.conf - for BIRD 2, this is a single file. For BIRD 1.6 (which we don't use), there's a separate file for IPv4 and IPv6.

You do not need to restart BIRD after making configuration changes - this will cause all BGP sessions, OSPF adjacencies etc to flap. Instead run:

birdc configure


BIRD has a CLI that you can use to see the state of the world.

You can run


to get a BIRD shell directly, and push ? lots to have it tell you what you're allowed to type.

Some common examples

To see all protocols and their state:

root@sown-gw2:~# birdc show proto
BIRD 2.0.7 ready.
Name       Proto      Table      State  Since         Info
device1    Device     ---        up     11:05:56.616  
kernel4    Kernel     master4    up     11:07:46.564  
kernel6    Kernel     master6    up     11:07:46.564  
ospf4      OSPF       master4    up     13:13:13.923  Running
ospf6      OSPF       master6    up     11:07:46.564  Running

To see OSPF neighbours:

root@sown-gw2:~# birdc show ospf neigh ospf4
BIRD 2.0.7 ready.
Router ID   	Pri	     State     	DTime	Interface  Router IP  	  1	Full/DR   	39.802	eth0       fe80::5054:ff:fe85:fe05

To see BIRD's routing tables:

root@sown-gw2:~# birdc show route
BIRD 2.0.7 ready.
Table master4:    unicast [ospf4 13:13:25.024] I (150/10) []
	via on eth0          unicast [ospf4 13:13:25.024] I (150/10) []
	dev eth0        unicast [ospf4 13:13:25.024] E2 (150/10/10000) [] 
	via on eth0       unicast [ospf4 13:13:25.024] E2 (150/10/10000) []
	via on eth0

Table master6:
2001:630:d0:f700::/64 unicast [ospf6 11:07:46.665] I (150/10) []
	dev eth0

Disable a protocol (can be useful when doing maintenance and wanting to isolate a router, note this is temporary and will be cleared on restart/reload):

root@sown-gw2:~# birdc disable ospf4
BIRD 2.0.7 ready.
ospf4: disabled

See what BIRD thinks it's sending to the kernel:

root@sown-gw2:~# birdc show route export kernel6
BIRD 2.0.7 ready.
Table master6:
2001:630:d0:f700::/64 unicast [ospf6 11:07:46.664] I (150/10) []
	dev eth0

See what it's actually sending:

root@sown-gw2:~# ip -6 route show proto bird
2001:630:d0:f700::/64 dev eth0 metric 32 pref medium