Sunday, September 18, 2016

bgp peering using bird

BIRD is a Internet Routing Daemon, it can run on many major os platforms such Linux, FreeBSD, and other Unix-like systems.

It supports many different routing protocols such as
    Multiple routing tables
    Static routes
    IPv6 Router Advertisements
    Inter-table protocol

1- install bird on ubuntu xenial 16.04
$ sudo apt-get install bird

- start the bird daemon
$ sudo /etc/init.d/bird restart

2-  we will peer with router, asn=1, accept all route and advertise, so update bird configure file /etc/bird/bird.conf as below

router id;
protocol kernel {
    export all;
    scan time 60;
    import none;
protocol device {
    scan time 60;
protocol static bgproutes {
    import all;
    route via;

protocol bgp{
  import all;
  export where proto = "bgproutes"
#  export all;
  next hop self;
  description "peer n1";
  neighbor as 1;
  local as 2;

3- interface with bird daemon with birdc
$ sudo birdc
- to update configuration file update edit use command configure
bird> configure
Reading configuration from /etc/bird/bird.conf

4- on other site router configuration.
router bgp 1
 bgp router-id
 redistribute connected
 neighbor s1 peer-group
 neighbor s1 remote-as 2
 neighbor s1 soft-reconfiguration inbound
 neighbor peer-group s1

5- show the routes of both routers

- bird
bird> show route       via on ens38 [bgp1 08:38:37] * (100) [AS1i]        via on ens38 [bgp1 08:38:37] ! (100) [AS1i]   via on ens38 [bgproutes 08:37:44] * (200)

- other router
n1# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, A - Babel,
       > - selected route, * - FIB route

C>* is directly connected, eth0
C>* is directly connected, lo
B>* [20/0] via, eth0, 00:11:00

No comments:

Post a Comment