Route redistribution between OSPF instances
Hello, I need some help in understanding bird. Route redistribution between ospf instances doesn't work for me. I tried everything I could think of short of debugging source code, and narrowed it down to route type. If it's RTS_OSPF_IA, ospf_metric2 is set to LSINFINITY. How I wanted to use it: VM announces some /32 net in area 20. This net is received by vm's host into table_ospf_0 and redistributed to: 1) backbone area so other vm hosts can reach it 2) table_allroutes via a pipe. Ospf_allroutes protocol takes it from table_allroutes and announces it to everyone in area 30. Am I doing something stupid? Should it even work? Minimal config example: ipv4 table table_ospf_0; # contains host-host vm /32 ip announces ipv4 table table_allroutes; # contains all routes learned. protocol pipe pipe_ospf_0_allroutes { table table_ospf_0; peer table table_allroutes; import none ; export filter { if (net.len = 32) then accept; else reject; } ; } protocol ospf ospf_vm { ipv4 { table table_ospf_0; export all; import filter filter_from_ospf; }; # meant for host-host vm /32 ip announces # without it, best route to other host's vm will be via PE area 0.0.0.0 { interface "ospf0-br" { authentication cryptographic; password "pass1"; }; }; # meant for ip announces. area 0.0.0.20 { interface "ospf20-br" { authentication cryptographic; password "pass2"; }; }; } protocol ospf ospf_allroutes { ipv4 { table table_allroutes; import keep filtered on; export all; import filter filter_to_kernel; }; # Meant for vm's that want to accept ALL routes with per-vrf ospf tag area 0.0.0.30 { interface "ospf30-br" { authentication cryptographic; password "pass3"; }; }; } How route is seen: Imported from other vm host via ospf: bird> show route table table_ospf_0 10.20.5.135/32 all Table table_ospf_0: 10.20.5.135/32 unicast [ospf_vm 13:52:53.209] IA (150/20) [10.255.10.129] via 10.133.146.12 on ospf0-br Type: OSPF-IA univ Piped to table_allroutes: (as expected, nothing changed) bird> show route table table_allroutes 10.20.5.135/32 all Table table_allroutes: 10.20.5.135/32 unicast [ospf_vm 13:52:53.209] IA (150/20) [10.255.10.129] via 10.133.146.12 on ospf0-br Type: OSPF-IA univ In ospf_vm: # birdc show ospf state ospf_vm area 0.0.0.0 router 10.255.10.129 distance 10 ... xnetwork 10.20.5.135/32 metric 10 ... xrouter 10.20.5.135 metric 10 area 0.0.0.20 router 10.255.10.128 distance 0 xnetwork 10.20.5.135/32 metric 20 ... xrouter 10.20.5.135 metric 20 # birdc show ospf state ospf_allroutes area 0.0.0.30 router 10.255.10.128 distance 0 external 10.20.5.135/32 metric2 16777215
On Mon, Mar 04, 2019 at 04:54:10PM +0300, Yaroslav Dronskii wrote:
Hello, I need some help in understanding bird. Route redistribution between ospf instances doesn't work for me. I tried everything I could think of short of debugging source code, and narrowed it down to route type. If it's RTS_OSPF_IA, ospf_metric2 is set to LSINFINITY.
Hello This seems like a bug in BIRD. OSPF generated routes other than E2 (type 2 external) have attribute ospf_metric2 set to LSINFINITY, but when a route is exported to OSPF and have ospf_metric2 set (even to LSINFINITY), then it is generated as E2 with given metric. We should generate ospf_metric2 attribute only for E2 routes. There is a simple workaround: In OSPF export filter, use this command: unset(ospf_metric2); That would generate E1 routes from IA routes. Or just set ospf_metric2 to a sane value to generate E2 routes.
How route is seen: Imported from other vm host via ospf: bird> show route table table_ospf_0 10.20.5.135/32 all Table table_ospf_0: 10.20.5.135/32 unicast [ospf_vm 13:52:53.209] IA (150/20) [10.255.10.129] via 10.133.146.12 on ospf0-br Type: OSPF-IA univ
This seems like another bug, there should be list of OSPF attributes. -- 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."
Thank you, the unset workaround works just fine. By the way, unset() is not mentioned in documentation :-) On 3/5/19 7:32 PM, Ondrej Zajicek wrote:
On Mon, Mar 04, 2019 at 04:54:10PM +0300, Yaroslav Dronskii wrote:
Hello, I need some help in understanding bird. Route redistribution between ospf instances doesn't work for me. I tried everything I could think of short of debugging source code, and narrowed it down to route type. If it's RTS_OSPF_IA, ospf_metric2 is set to LSINFINITY. Hello
This seems like a bug in BIRD. OSPF generated routes other than E2 (type 2 external) have attribute ospf_metric2 set to LSINFINITY, but when a route is exported to OSPF and have ospf_metric2 set (even to LSINFINITY), then it is generated as E2 with given metric. We should generate ospf_metric2 attribute only for E2 routes.
There is a simple workaround: In OSPF export filter, use this command:
unset(ospf_metric2);
That would generate E1 routes from IA routes. Or just set ospf_metric2 to a sane value to generate E2 routes.
How route is seen: Imported from other vm host via ospf: bird> show route table table_ospf_0 10.20.5.135/32 all Table table_ospf_0: 10.20.5.135/32 unicast [ospf_vm 13:52:53.209] IA (150/20) [10.255.10.129] via 10.133.146.12 on ospf0-br Type: OSPF-IA univ This seems like another bug, there should be list of OSPF attributes.
participants (3)
-
Ondrej Zajicek -
Yaroslav Dronskii -
Yaroslav Dronskiy