Configuration Problem : announce default route via ospf
Hello list, I'm a new user of bird. I'm using quagga or openospdf in production for time (also cisco and junos). Bird have an excellent reputation and a small footprint. I m trying to replace my old quagga on embedded box (running openwrt) with bird. The configuration look very flexible but I'm facing with a problem. What I try to make is announcing a default route in ospf, and also set some specific metric. I'm lost with that. The quagga/ospfd relevant part of configuration I try to make : - snip - interface lo2 ip ospf cost 100 router ospf ospf router-id 0.0.0.9 redistribute connected route-map connected_to_ospf passive-interface lo0 passive-interface lo1 passive-interface lo2 network 192.168.0.0/24 area 0.0.0.5 network 192.168.10.9/32 area 0.0.0.5 network 192.168.10.53/32 area 0.0.0.5 default-information originate metric 100 ! access-list access permit 127.0.0.1/32 access-list access deny any ! route-map connected_to_ospf deny 10 match interface mpe0 ! route-map connected_to_ospf deny 15 match interface vlan44 ! route-map connected_to_ospf permit 20 match interface lo2 set metric 100 set metric-type type-1 - /snip - I gave up with a config like this : - snip - router id 0.0.0.9; protocol device { scan time 10; } filter export_OSPF { if ( net = 0.0.0.0/0 ) then { print "default net accepted:", net; ospf_metric1 = 100; accept; } accept } protocol kernel { debug all; learn; scan time 2; import all; export all; } protocol ospf { debug all; import all; export filter export_OSPF; area 0.0.0.5 { stubnet 192.168.10.53/32 { cost 100; }; interface "lo1" { stub; }; interface "lo2" { stub; }; interface "vr0" { cost 5; type broadcast; }; interface "vr1" { stub; cost 200; }; }; } - /snip - It's not working as expected. In fact I'm trying to redistribute defautl kernel route into ospf. but it seems to be ignored, and the default was not seeen in the ospf database. What I am missing ? Is there a better way to inject a default route like in quagga (default originate). Regards, -- Raphael Mazelier
On Sun, Jan 13, 2013 at 05:07:46PM +0100, Raphael Mazelier wrote:
Hello list,
I'm a new user of bird. I'm using quagga or openospdf in production for time (also cisco and junos). Bird have an excellent reputation and a small footprint. I m trying to replace my old quagga on embedded box (running openwrt) with bird. The configuration look very flexible but I'm facing with a problem. What I try to make is announcing a default route in ospf, and also set some specific metric. I'm lost with that.
Hello I don't see any problem, your config works for me (without the obvious typo of missing semicolon in filter export_OSPF), default route is exported in both 1.3.9 and 1.3.6 (default route could be seen in both 'show ospf state' and 'show ospf lsadb'). There were some bugs in pre-1.3.9 that causes default route to disappear or does not allow to export routes to OSPF, but they were all related to configurations with multiple areas. Your config would not work if there is already one default route in OSPF domain, it would be imported to main routing table and blocks exporting the default route from kernel protocol (because of higher default priority of OSPF routes), but this you could see in 'show route'. You could try to change export in OSPF to 'export all', try to replace kernel default route with static default route, or you could change area in OSPF to 0.0.0.0 (backbone) to see what your problem is related to. -- 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."
Hello
I don't see any problem, your config works for me (without the obvious typo of missing semicolon in filter export_OSPF), default route is exported in both 1.3.9 and 1.3.6 (default route could be seen in both 'show ospf state' and 'show ospf lsadb'). I use bird-1.3.7 from openbsd ports There were some bugs in pre-1.3.9 that causes default route to disappear or does not allow to export routes to OSPF, but they were all related to configurations with multiple areas. No multiple areas here. Your config would not work if there is already one default route in OSPF domain, it would be imported to main routing table and blocks exporting the default route from kernel protocol (because of higher default priority of OSPF routes), but this you could see in 'show route'. Ah that's the point. I've already got a default route announced by another route, but this is what I want. In my setup I want both router advertise the default and play on metric.
bird> show route 0.0.0.0/0 via 192.168.0.1 on vr0 [ospf1 21:09] * E2 (150/15/80) [0.0.0.1] via 81.220.124.1 on vr1 [kernel1 21:09] (10) bird> show ospf state router 0.0.0.1 distance 5 ... external 0.0.0.0/0 metric2 80 via 82.243.43.254
You could try to change export in OSPF to 'export all', try to replace kernel default route with static default route, or you could change area in OSPF to 0.0.0.0 (backbone) to see what your problem is related to.
I've tried export all with no success. But my problem is clearly related to an already default in ospf. So what your advise ? Can I filter the default advertise by another router ? play with metric ? -- Raphael Mazelier
On Mon, Jan 14, 2013 at 09:12:30PM +0100, RR wrote:
Your config would not work if there is already one default route in OSPF domain, it would be imported to main routing table and blocks exporting the default route from kernel protocol (because of higher default priority of OSPF routes), but this you could see in 'show route'. Ah that's the point. I've already got a default route announced by another route, but this is what I want. In my setup I want both router advertise the default and play on metric.
bird> show route 0.0.0.0/0 via 192.168.0.1 on vr0 [ospf1 21:09] * E2 (150/15/80) via 81.220.124.1 on vr1 [kernel1 21:09] (10)
So what your advise ? Can I filter the default advertise by another router ? play with metric ?
Not with metric but with preference. The OSPF route has preference 150 while the kernel route has preference 10. Use option 'preference' in kernel protocol to set higher value (like 200) for imported kernel routes. Or you could use static protocol to define default route (static protocol has default preference 200). -- 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."
Not with metric but with preference. The OSPF route has preference 150 while the kernel route has preference 10. Use option 'preference' in kernel protocol to set higher value (like 200) for imported kernel routes. Or you could use static protocol to define default route (static protocol has default preference 200).
Thanks a lot. My final working config is : # redistribute default filter export_OSPF { if ( net = 0.0.0.0/0 ) then { ospf_metric2 = 100; accept; } reject; } protocol kernel { learn; preference 200; scan time 2; import all; export all; } protocol ospf { import all; export filter export_OSPF; ... Looks good. -- Raphael Mazelier
participants (3)
-
Ondrej Zajicek -
Raphael Mazelier -
RR