Inject ethernet-based defaults to OSPF
Hello list, I???m looking for some advice from someone that has more experience. I'm running bird 1.6.6. I have two routers R1 and R2, each with a single internet uplink U1 and U2, running OSPF and sharing a LAN ethernet segment. Both U1 and U2 are dhcp-based ethernet segments themselves with a next-hop IP address that can change. I want R1 to be the primary LAN internet gateway and R2 the secondary. Should U1 fail, R1 has to route to R2 in order to reach internet through U2. How would you recommend to inject U1 and U2 default routes into OSPF? I cannot use the next-hop ip address as it changes along time, and an interface-based static route would not work. thanks a lot, d
On Wed, Sep 18, 2019 at 11:53:30AM +0200, daniele wrote:
Hello list, I???m looking for some advice from someone that has more experience. I'm running bird 1.6.6. I have two routers R1 and R2, each with a single internet uplink U1 and U2, running OSPF and sharing a LAN ethernet segment. Both U1 and U2 are dhcp-based ethernet segments themselves with a next-hop IP address that can change. I want R1 to be the primary LAN internet gateway and R2 the secondary. Should U1 fail, R1 has to route to R2 in order to reach internet through U2. How would you recommend to inject U1 and U2 default routes into OSPF? I cannot use the next-hop ip address as it changes along time, and an interface-based static route would not work.
Hello I would suggest learn default route using kernel protocol (allow in import, option 'learn'). Then set ospf_metric2 in OSPF export filter (different on R1 and on R2). -- 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."
Nice, will try that. One additional question: if leverage kernel protocol, it means local routing tables already contain the default learnt through DHCP. Wouldn't this generate some kind of warning (ie. bird4: Netlink: File exists) when bird, say on R2 to install R1 as default, tries to overwrite the local default with the one generated by OSPF? cheers On 19/09/2019 13:20, Ondrej Zajicek wrote:
On Wed, Sep 18, 2019 at 11:53:30AM +0200, daniele wrote:
Hello list, I???m looking for some advice from someone that has more experience. I'm running bird 1.6.6. I have two routers R1 and R2, each with a single internet uplink U1 and U2, running OSPF and sharing a LAN ethernet segment. Both U1 and U2 are dhcp-based ethernet segments themselves with a next-hop IP address that can change. I want R1 to be the primary LAN internet gateway and R2 the secondary. Should U1 fail, R1 has to route to R2 in order to reach internet through U2. How would you recommend to inject U1 and U2 default routes into OSPF? I cannot use the next-hop ip address as it changes along time, and an interface-based static route would not work. Hello
I would suggest learn default route using kernel protocol (allow in import, option 'learn'). Then set ospf_metric2 in OSPF export filter (different on R1 and on R2).
On Fri, Sep 20, 2019 at 09:25:45AM +0200, daniele wrote:
Nice, will try that. One additional question: if leverage kernel protocol, it means local routing tables already contain the default learnt through DHCP. Wouldn't this generate some kind of warning (ie. bird4: Netlink: File exists) when bird, say on R2 to install R1 as default, tries to overwrite the local default with the one generated by OSPF?
It will try to install it on both R1 and R2 (as kernel-learned routes has lower default preference than OSPF routes). In that case it will generate warning. On Linux, it is suggested to use 'metric' option of kernel protocol to avoid collision with alien routes. But in your case the proper solution is to set preference of kernel protocol higher than OSPF (say 160). -- 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."
Hi all, I have two sites, two links in between, one is high bandwith/high latency (HB), the other is low bandwidth/low latency (LB), bird 1.6.8. I neet all traffic to flow on HB link except for real time, which in my case is RTP that goes through LB. To achieve this, I'm using PBR with two kernel routing tables: main should have HB route as preferred route, low_latency should have LB as preferred. Should any of the two fail, all traffic needs to be routed on the other link. Problem is to properly populate the tables. Local interface states are not reliable in terms of actual link availability, and anyways I'm already using OSPF in the whole network setup. Currently in bird OSPF runs and populate the main table, then I have a dedicated pipe+kernel populating the low_latency one. Of course OSPF elects the preferred route based on link costs, so only that route gets into bird routing table, and it's the only one that can be eventually piped into low_latency table. This way, all traffic goes either HB or LB depending on OSPF link costs because the two routing tables are identical. Is there a way to get both routes learnt through OSPF into bird table and then apply a filter to the pipe in order to swap the preference when propagating those routes into the low_latency table? Or any other suggestion to rework this in order to achieve the goal above? thanks G.
On Thu, Nov 26, 2020 at 12:59:13PM +0100, Gianguido wrote:
Hi all,
I have two sites, two links in between, one is high bandwith/high latency (HB), the other is low bandwidth/low latency (LB), bird 1.6.8. I neet all traffic to flow on HB link except for real time, which in my case is RTP that goes through LB. To achieve this, I'm using PBR with two kernel routing tables: main should have HB route as preferred route, low_latency should have LB as preferred. Should any of the two fail, all traffic needs to be routed on the other link.
Problem is to properly populate the tables. Local interface states are not reliable in terms of actual link availability, and anyways I'm already using OSPF in the whole network setup. Currently in bird OSPF runs and populate the main table, then I have a dedicated pipe+kernel populating the low_latency one. Of course OSPF elects the preferred route based on link costs, so only that route gets into bird routing table, and it's the only one that can be eventually piped into low_latency table. This way, all traffic goes either HB or LB depending on OSPF link costs because the two routing tables are identical.
Is there a way to get both routes learnt through OSPF into bird table and then apply a filter to the pipe in order to swap the preference when propagating those routes into the low_latency table? Or any other suggestion to rework this in order to achieve the goal above?
Hi Not really, OSPF does not work this way. You can use different routing protocols (e.g. BGP with BFD for quick failover), or use two OSPF instances with different 'instance id' and metrics. -- 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."
Can I assign the same interfaces to two independent OSPF instances? On 26/11/2020 13:37, Ondrej Zajicek wrote:
On Thu, Nov 26, 2020 at 12:59:13PM +0100, Gianguido wrote:
Hi all,
I have two sites, two links in between, one is high bandwith/high latency (HB), the other is low bandwidth/low latency (LB), bird 1.6.8. I neet all traffic to flow on HB link except for real time, which in my case is RTP that goes through LB. To achieve this, I'm using PBR with two kernel routing tables: main should have HB route as preferred route, low_latency should have LB as preferred. Should any of the two fail, all traffic needs to be routed on the other link.
Problem is to properly populate the tables. Local interface states are not reliable in terms of actual link availability, and anyways I'm already using OSPF in the whole network setup. Currently in bird OSPF runs and populate the main table, then I have a dedicated pipe+kernel populating the low_latency one. Of course OSPF elects the preferred route based on link costs, so only that route gets into bird routing table, and it's the only one that can be eventually piped into low_latency table. This way, all traffic goes either HB or LB depending on OSPF link costs because the two routing tables are identical.
Is there a way to get both routes learnt through OSPF into bird table and then apply a filter to the pipe in order to swap the preference when propagating those routes into the low_latency table? Or any other suggestion to rework this in order to achieve the goal above? Hi
Not really, OSPF does not work this way. You can use different routing protocols (e.g. BGP with BFD for quick failover), or use two OSPF instances with different 'instance id' and metrics.
On Thu, Nov 26, 2020 at 03:09:25PM +0100, Gianguido wrote:
Can I assign the same interfaces to two independent OSPF instances?
Yes, if they use different 'instance id' (RFC 6549). Note that RFC 6549 is an extension, it is supported by BIRD, but not necessary by other OSPF implementations. -- 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."
thanks a lot, I did further research following up your last message, and by adding another 'instance id' in the interface declaration I managed to have two OSPF instances running independently and contemporarily on the same interfaces, each one feeding its own kernel routing table. it works perfectly. For future reference, instance basic declaration looks like this: protocol ospf main{ ecmp yes; export all; import filter defilter; area 0 { interface "wg5" {type ptp;cost 30;ecmp weight 10;}; interface "tun50" {type ptp;cost 30;ecmp weight 50;}; }; } protocol ospf lowlatency{ table lowlatency; export none; import all; area 0 { interface "tun50" instance 1 {type ptp;cost 40;}; interface "wg5" instance 1 {type ptp;cost 30;}; }; } thanks Daniele On 01/12/2020 16:43, Ondrej Zajicek wrote:
On Thu, Nov 26, 2020 at 03:09:25PM +0100, Gianguido wrote:
Can I assign the same interfaces to two independent OSPF instances? Yes, if they use different 'instance id' (RFC 6549). Note that RFC 6549 is an extension, it is supported by BIRD, but not necessary by other OSPF implementations.
participants (3)
-
daniele -
Gianguido -
Ondrej Zajicek