Problem importing routes from kernel
Good day. I'm new to BIRD, and am having an issue that's hopefully a simple fix. I'm running bird 1.2.5-1 on Debian, installed via package. My end goal is to use the BIRD process as a RTBH trigger via BGP. Currently, I'm unable to get BIRD to import kernel routes into the BIRD process, aside from the system default route. Interaction with the kernel definitely works; when I peer up with my BGP neighbor, our edge router with public BGP routes, they import and show up in the kernel route table without a problem. Here's my route table, and relevant sections of the BIRD config, and outputs from birdc. Thanks in advance for any assistance. root@genericsystemsimage:~# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.100.100 * 255.255.255.255 UH 0 0 0 eth0 207.251.204.0 * 255.255.255.240 U 0 0 0 eth0 default host-10.204-251 0.0.0.0 UG 0 0 0 eth0 root@genericsystemsimage:~# protocol kernel { learn; # Learn all alien routes from the kernel persist; # Don't remove routes on bird shutdown scan time 20; # Scan kernel routing table every 20 seconds import all; # Default is import all export all; # Default is export none } protocol device { scan time 10; # Scan interfaces every 10 seconds } protocol bgp test { description "Test peer"; local as XXXX; neighbor A.B.C.D as XXXX; import none; export all; } bird> show route 0.0.0.0/0 via 207.251.204.10 on eth0 [kernel1 16:57] * (10) bird> show protocols all name proto table state since info kernel1 Kernel master up 16:57 Preference: 10 Input filter: ACCEPT Output filter: ACCEPT Routes: 1 imported, 0 exported, 1 preferred Route change stats: received rejected filtered ignored accepted Import updates: 1 0 0 0 1 Import withdraws: 0 0 --- 0 0 Export updates: 1 1 0 --- 0 Export withdraws: 0 --- --- --- 0 -- Thomas Beecher II Senior Network Administrator LocalNet Corp. CoreComm Internet Services tbeecher at localnet dot com
Hi, Le jeudi 18 octobre 2012 à 16:57 -0400, Tom Beecher a écrit :
Currently, I'm unable to get BIRD to import kernel routes into the BIRD process, aside from the system default route.
BIRD doesn't import device routes with the kernel protocol. You want a “direct” protocol for that; see http://bird.network.cz/?get_doc&f=bird-6.html#ss6.3 (and there are some threads about that “issue” in the ML archives too, I think) Regards, benjamin
Thanks Benjamin for that tidbit. I must have misread that part of the docs. (And missed in the the archives when I searched.) Added this to my bird.conf: protocol direct { interface "*"; } Results in this : bird> show route 0.0.0.0/0 via 207.251.204.10 on eth0 [kernel1 09:56] * (10) 207.251.204.0/28 dev eth0 [direct1 09:56] * (240) bird> That much I follow, but the 172 route still doesn't appear. To clarify, I manually added that with : route add -host 172.16.100.100 dev eth0 It was my assumption that because the 172 route was manually added I needed to access it through the kernel protocol, which is why that's why I was going in that direction. Am I missing something else simple here? Thanks. On 10/19/2012 6:06 AM, Benjamin Cama wrote:
Hi,
Le jeudi 18 octobre 2012 à 16:57 -0400, Tom Beecher a écrit :
Currently, I'm unable to get BIRD to import kernel routes into the BIRD process, aside from the system default route. BIRD doesn't import device routes with the kernel protocol. You want a “direct” protocol for that; see http://bird.network.cz/?get_doc&f=bird-6.html#ss6.3
(and there are some threads about that “issue” in the ML archives too, I think)
Regards, benjamin
On Fri, Oct 19, 2012 at 10:06:30AM -0400, Tom Beecher wrote:
That much I follow, but the 172 route still doesn't appear. To clarify, I manually added that with :
route add -host 172.16.100.100 dev eth0
It was my assumption that because the 172 route was manually added I needed to access it through the kernel protocol, which is why that's why I was going in that direction.
Yes, you are right, manually added routes should be imported by kernel protocol (while 'native' device routes that are created by kernel could be imported using direct protocol).
Am I missing something else simple here?
There is one issue related to routes without gateway, see this thread: http://www.mail-archive.com/bird-users@atrey.karlin.mff.cuni.cz/msg01039.htm... In short, there are two ways to fix it. Either use attached patch to BIRD source and rebuild, or create these routes with another 'protocol source'. I don't know whether 'protocol source' could be changed when route is added using 'route' command, but for 'ip' command you can use ip route add 172.16.100.100/32 dev eth0 proto static instead of just ip route add 172.16.100.100/32 dev eth0 -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Ondrej- Thanks for that info. Adding the route in using ip route add, and proto static did the trick. Popped right in, and everything else worked as expected. Also, message received regarding the package upgrade. I simply grabbed it quick for this development box, but I'll be sure to upgrade it before I put it into production. Thanks to everyone for their assistance. Tom On 10/19/2012 5:21 PM, Ondrej Zajicek wrote:
On Fri, Oct 19, 2012 at 10:06:30AM -0400, Tom Beecher wrote:
That much I follow, but the 172 route still doesn't appear. To clarify, I manually added that with :
route add -host 172.16.100.100 dev eth0
It was my assumption that because the 172 route was manually added I needed to access it through the kernel protocol, which is why that's why I was going in that direction. Yes, you are right, manually added routes should be imported by kernel protocol (while 'native' device routes that are created by kernel could be imported using direct protocol).
Am I missing something else simple here? There is one issue related to routes without gateway, see this thread:
http://www.mail-archive.com/bird-users@atrey.karlin.mff.cuni.cz/msg01039.htm...
In short, there are two ways to fix it. Either use attached patch to BIRD source and rebuild, or create these routes with another 'protocol source'. I don't know whether 'protocol source' could be changed when route is added using 'route' command, but for 'ip' command you can use
ip route add 172.16.100.100/32 dev eth0 proto static
instead of just
ip route add 172.16.100.100/32 dev eth0
I'm running bird 1.2.5-1 on Debian, installed via package
BTW, you should definitely upgrade to newer version, here are current packages for Debian: http://bird.network.cz/?download&tdir=debian/dists/ -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (3)
-
Benjamin Cama -
Ondrej Zajicek -
Tom Beecher