Reply
Emerging Member
Posts: 75
Registered: ‎08-09-2015
Kudos: 7
Solutions: 3

Failover port gateway definition in load balance failover with two static interfaces

Both my primary and secondary WANs are statically defined.  I have entered the primary WAN GW and DNS addresses in the 'System' page, but it isn't clear where I define the GW for my WAN 2 port.  The load balance wizard asks for and remembers that WAN 2 GW, but I can't find that GW value in the ERX configuration.  Where is it defined?

Senior Member
Posts: 5,692
Registered: ‎01-04-2017
Kudos: 797
Solutions: 288

Re: Failover port gateway definition in load balance failover with two static interfaces

Should be defined as a static route
Emerging Member
Posts: 75
Registered: ‎08-09-2015
Kudos: 7
Solutions: 3

Re: Failover port gateway definition in load balance failover with two static interfaces

On the wizard configured ERX, when both eth are active the route table includes 'default proto zebra...'  

when the primary WAN connection is removed the table contains  a simple default route to the WAN2 GW.

Is there are 'zebra' service I should configure?

 

 

bnt@Paia-ERX:/etc$ ip route
0.0.0.0/24 dev vtun0 proto kernel scope link
default proto zebra
nexthop via 192.168.161.1 dev eth1 weight 1
nexthop via 192.168.157.1 dev eth0 weight 1
10.168.162.0/24 dev vtun0 proto kernel scope link src 10.168.162.1
192.168.157.0/24 dev eth0 proto kernel scope link src 192.168.157.133
192.168.161.0/24 dev eth1 proto kernel scope link src 192.168.161.192
192.168.162.0/24 dev switch0 proto kernel scope link src 192.168.162.1

Veteran Member
Posts: 7,253
Registered: ‎03-24-2016
Kudos: 1867
Solutions: 823

Re: Failover port gateway definition in load balance failover with two static interfaces

zebra is the glimpse you see of the routing deamon under the hood.

 

Better run below, to see routes/types with more descriptive origin:

Spoiler
show ip route
Emerging Member
Posts: 75
Registered: ‎08-09-2015
Kudos: 7
Solutions: 3

Re: Failover port gateway definition in load balance failover with two static interfaces

My routing question is really derived from my attempt to solve a system reliabilty problem, so I will start with a description of my goal. 

 

I operate a small WISP of 25 clients with two base stations sericed by different ISPs.  Some clients have line-of-sight only to BASE1 on LAN1 10.0.1.x, while others see only BASE2 and are on LAN2 10.0.2.x.  There is one radio link between BASE1 and BASE2 and all of the radios are in bridging mode.  The radios have been 100% reliable, but the ISPs fail for minutes or hours several times per month.

 

ISP1 ===> ERX1 10.0.1.1 ====> LAN 10.0.1.x

                                               ||

ISP2 ===> ERX2 10.0.2.1 ====> LAN 10.0.2.x

 

So when BASE1 when ISP1 fails I want the ERX1 to tempoarily forward traffic to ERX2 and then fail back once ISP1 service is restored.  I have suceeded in using the load balance wizard to configure ERX1 to use eth1 with address 10.0.2.11 GW /DNS == 10.0.2.1 as WAN2 and I connect a jumper cable from eth1 to eth2 (one of the switch0 LAN ports).  In failover the LANs are running very inefficiently, but other than slower speeds there is no effect upon my clients configurations which a big bonus for me.

 

While this configuration works perfectly, it wastes two physical ports and forces me to add an external ethernet switch when I need more than two physical LAN ports on the ERX.  It seems to me that I could free eth1 and eth2 if I could only change the load balance configuration from 'eth1' to 'switch0' and add a second LAN2 address to switch0.

 

To do that on an ERX configured with the load balance wizard, there appears to be a routing service configured to change the table,  gateway and DNS when there is a failover event, as shown below.  but I can't find it to change it to match my network configuration.

 

eth0 and eth1 both active:

 

ubnt@Paia-ERX:~$ show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
> - selected route, * - FIB route, p - stale info

IP Route Table for VRF "default"
S *> 0.0.0.0/0 [210/0] via 192.168.161.1, eth1
*> [210/0] via 192.168.157.1, eth0
C *> 0.0.0.0/24 is directly connected, vtun0
C *> 10.168.162.0/24 is directly connected, vtun0
C *> 127.0.0.0/8 is directly connected, lo
C *> 192.168.157.0/24 is directly connected, eth0
C *> 192.168.161.0/24 is directly connected, eth1
C 192.168.161.0/24 is directly connected, switch0
S 192.168.161.0/24 [2/0] via 192.168.160.8 (recursive via 192.168.161.1
via 192.168.157.1 )
C *> 192.168.162.0/24 is directly connected, switch0
ubnt@Paia-ERX:~$ 

 

With eth0 inactive:

 

ubnt@Paia-ERX:~$ show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
> - selected route, * - FIB route, p - stale info

IP Route Table for VRF "default"
S *> 0.0.0.0/0 [210/0] via 192.168.161.1, eth1
C *> 0.0.0.0/24 is directly connected, vtun0
C *> 10.168.162.0/24 is directly connected, vtun0
C *> 127.0.0.0/8 is directly connected, lo
C *> 192.168.161.0/24 is directly connected, eth1
C 192.168.161.0/24 is directly connected, switch0
S 192.168.161.0/24 [2/0] via 192.168.160.8 (recursive via 192.168.161.1 )
C *> 192.168.162.0/24 is directly connected, switch0
ubnt@Paia-ERX:~$

 

I am a networking noivce and open other solutions to this problem, but I do have a working if inelegant solution.  Thanks

Emerging Member
Posts: 75
Registered: ‎08-09-2015
Kudos: 7
Solutions: 3

Re: Failover port gateway definition in load balance failover with two static interfaces

I bludgeoned my way on my own to a very ubly but functional solution. 

Run the looback wizard make eth1 the WS2 failover port, run a loopback cable from eth1 to LAN eth2, then raise the distance in the static route to the WAN2 default route gateway.

There is certainly a better way to achieve this which wouldn't require the loopback cable, but I have burned days getting it to work this way, so this is how Ill deploy it.

Reply