Score:0

How to add the normal routing information of a router to BIRD?

us flag

Suppose the following network layout:

                         R1:                                   R2:
10.1.1.0/24 <--- 10.1.1.1, 192.168.1.1 <----------> 192.168.1.2, 10.1.2.1 ---> 10.1.2.0/24 

BIRD is installed on both R1 and R2. All information about the network topology is automatically given. It was my understanding that BIRD would automatically redistribute this information so that all stations can connect. But it does not seem as straight forward: R1 and R2 both automatically create "dynamic" routes for their respective subnets but they do not get handled automatically.

The device protocol does not import/export routes. The docs say about the direct protocol:

[...] Although there are some use cases that use the direct protocol (like abusing eBGP as an IGP routing protocol), in most cases it is not needed to have these device routes in BIRD routing table and to use the direct protocol. [...]

I thought the kernel protocol would automatically import these routes because they are part of the kernel routing table. But the documentation states:

Unfortunately, there is one thing that makes the routing table synchronization a bit more complicated. In the kernel routing table there are also device routes for directly connected networks. These routes are usually managed by OS itself (as a part of IP address configuration) and we don't want to touch that. They are completely ignored during the scan of the kernel tables and also the export of device routes from BIRD tables to kernel routing tables is restricted to prevent accidental interference.

So nobody (no protocol) wants to be responsible for distributing the very routes which would make the two networks connect. What's left is static but they I would need to recreate the whole connectivity of a router in the bird config file, something I thought OSPF over BIRD would do for me. Is this what I am supposed to do?

How should the config files for R1 and R2 look like?

router id 192.168.1.1;
protocol device {
  scan time 10;
}
protocol direct {
  interface "*"; # should I use this?
}
protocol kernel {
  learn;
  export all;
  import all;
  device routes true; # OR SHALL I USE THIS?
}
# I would like to avoid doing this:
#protocol static {
#  export all;
#  route 10.1.1.0/24 via 192.168.1.1;
#}
protocol ospf {
  import all;
  export all;
  area 0 {
    interface "eth0", "eth1" {
      cost 10; hello 10; transmit 2; wait 5; dead 40;
      type broadcast;
      authentication cryptographic;
      password "1234567890";
    };
  };
}

And:

router id 192.168.1.2;
protocol device {
  scan time 10;
}
protocol direct {
  interface "*"; # should I use this?
}
protocol kernel {
  learn;
  export all;
  import all;
  device routes true; # OR SHALL I USE THIS?
}
# I would like to avoid doing this:
#protocol static {
#  export all;
#  route 10.1.2.0/24 via 192.168.1.2;
#}
protocol ospf {
  import all;
  export all;
  area 0 {
    interface "eth0", "eth1" {
      cost 10; hello 10; transmit 2; wait 5; dead 40;
      type broadcast;
      authentication cryptographic;
      password "1234567890";
    };
  };
}
Ron Trunk avatar
in flag
You shouldn't have to create static routes. Are you sure your two routers have created neighbor relationships?
us flag
@RonTrunk Yes they have. But the information has of the route has to get somehow into the routing table (`birdc show route`) but that's empty.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.