Reply
Emerging Member
Posts: 60
Registered: ‎01-14-2014
Kudos: 6

Alert On Failover And Disable Wifi On Failover

Hi everyone, I have done an installation in a sportsbar where we are using a USG pro and providing a separate WAP just for guests. The customer is having a lot of issues with him primary ISP so he has a 4G ISP as a failover. The concept is if the primary ISP fails, then he can still run his point of sale on the 4G network.

 

The issue is we need to provide notificiation to the customer when the failover happens, and we need to disable the guest WAP during that period.

 

Can anyone think of a way to handle this within Unifi? If not within Unifi, I have access to IP controlled power conditioners, network scanners, etc that I could potentially use, but I would like to use the Unifi.

 

Thanks for your help.

Emerging Member
Posts: 55
Registered: ‎03-19-2017
Kudos: 9
Solutions: 4

Re: Alert On Failover And Disable Wifi On Failover

@Smarthomes, The notification for WAN failover can be set inside most 4G Modem GUI. To disable the WAP on failover is a whole different ball game, i don't believe it's possible without being done manually.

Emerging Member
Posts: 60
Registered: ‎01-14-2014
Kudos: 6

Re: Alert On Failover And Disable Wifi On Failover

Is the port with the failover modem always live even when not in fail over mode?

 

In other words, could I ping that 4G modem from inside the LAN and not get a response until it is being used for WAN?

 

If so, that can help...... if it is still "live', the gateway just isnt routing all traffic through it, then that doesnt help me much.

Established Member
Posts: 1,213
Registered: ‎01-29-2015
Kudos: 155
Solutions: 47

Re: Alert On Failover And Disable Wifi On Failover

I would also like to receive an alert when a failover occurs. Right now it's all guesswork.

Ubiquiti Employee
Posts: 1,037
Registered: ‎02-28-2017
Kudos: 312
Solutions: 108

Re: Alert On Failover And Disable Wifi On Failover

Wan failover's show in the "alerts" button in the bottom right of the UniFi Controller, it will say something like:
Test-USG1 event: { "Group wan_failover" : "Interface eth2 to state failover"} 4:42 am 08/31/2018
Test-USG1 event: { "Group wan_failover" : "Interface pppoe0 to state active"} 4:42 am 08/31/2018

In Settings > Notifications > Gateway events, you should be able to set "gateway event" to email.
Brandon Jaffe | UniFi Routing & Switching | Austin, TX
Established Member
Posts: 1,213
Registered: ‎01-29-2015
Kudos: 155
Solutions: 47

Re: Alert On Failover And Disable Wifi On Failover

[ Edited ]

Clarification - I'd like EMAIL alerts. Man Happy I don't see a way to set them, and there's nothing going to my email when it fails over.

Established Member
Posts: 1,213
Registered: ‎01-29-2015
Kudos: 155
Solutions: 47

Re: Alert On Failover And Disable Wifi On Failover

To be clear, gateway events is checked for email alerts in my config.

 

 

gateway even.png
Highlighted
Ubiquiti Employee
Posts: 1,037
Registered: ‎02-28-2017
Kudos: 312
Solutions: 108

Re: Alert On Failover And Disable Wifi On Failover

They definitely come through via email, have you setup your SMTP server in the controller Settings > Controller > Mail server?

There's an article on how to set it up through gmail here:
https://help.ubnt.com/hc/en-us/articles/226590847-UniFi-How-To-Use-a-Free-Email-Service-as-SMTP-Serv...
Brandon Jaffe | UniFi Routing & Switching | Austin, TX
Established Member
Posts: 1,213
Registered: ‎01-29-2015
Kudos: 155
Solutions: 47

Re: Alert On Failover And Disable Wifi On Failover

[ Edited ]

Yes and I just did an email test and the test email came through. Later today when I'm not working, I'll pull a cable and test it again.

 

It could be that I'm on firmware 4.4.18. I had issues with .28 so I'm stuck here for the time being.

Emerging Member
Posts: 58
Registered: ‎10-11-2015
Kudos: 10
Solutions: 1

Re: Alert On Failover And Disable Wifi On Failover

Hi @UBNT-jaffe  

 

since i have updated severals sites/controllers, i don't have WAN notifications any more

 

Gateway events are checked ( event + alert + mail ), but :

 

nothing in controller UI

nothing by mail ( and SMTP via controller is working well with test mail )

 

but appear in USG log files

 

https://community.ubnt.com/t5/UniFi-Routing-Switching/No-more-WAN-alert-event-5-8-28-CK-and-4-4-22-5...

 

Thank you

 

Ubiquiti Employee
Posts: 1,037
Registered: ‎02-28-2017
Kudos: 312
Solutions: 108

Re: Alert On Failover And Disable Wifi On Failover

In UniFi Settings > Networks > edit WAN2 > is "Report Interface Events" checked?
Brandon Jaffe | UniFi Routing & Switching | Austin, TX
Emerging Member
Posts: 58
Registered: ‎10-11-2015
Kudos: 10
Solutions: 1

Re: Alert On Failover And Disable Wifi On Failover

@UBNT-jaffe For me, i do not have this check box 

 

no in WAN2, no in WAN1

 

neither in cloudkey controller, neither in controller under debian

Capture d’écran 2018-09-17 à 18.14.36.png
Ubiquiti Employee
Posts: 576
Registered: ‎02-13-2018
Kudos: 189
Solutions: 84

Re: Alert On Failover And Disable Wifi On Failover

Hi @GB_fr I'm working with @UBNT-jaffe on this and would like to help you guys track down what is causing this issue.

 

I noticed that you said the logs were showing up on the USG so I would like to move onto the controller to see what we can pick apart. 

 

 

The following instructions will show you how to get output from the MongoDB shell on your cloud key/ 

  1. SSH into the CK
  2. Type command: mongo localhost:27117/ace
  3. Type command: db.alarm.find({"key":"EVT_GW_Notification"})
  4. Copy this output to a .json formatter like this one or another of your choice. This will help with readability. 
  5. Do you see object entries listed here that correspond to your logs on the USG?

Have you ever had database issues in the past? I'm wondering if something may not be sitting right and need a repair on that database. If you want to find out if a repair would help you follow these instructions.

  1. SSH into the CK
  2. Type command: mongo localhost:27117/ace
  3. Type command: db.repairDatabase()
  4. Let this finish. Report back whether errors occur or not. 
  5. Type command: service unifi restart

If you would try to do a failover again and let me know how it goes that would be helpful. 

Adam Dipple | UniFi Support Team
Emerging Member
Posts: 58
Registered: ‎10-11-2015
Kudos: 10
Solutions: 1

Re: Alert On Failover And Disable Wifi On Failover

Hi @UBNT-AdamD

 

The last entry in the DB is the same in UI / Alert

Last event date is 8/28/2018 : the day i made CK firmware and USG firmware update

 

I confirm the log in USG contain WAN event

 

 

 

Sep  9 00:18:30 USG wlb: group wan_failover, interface pppoe2 going Inactive
Sep  9 00:18:30 USG wlb: group wan_failover, interface eth3 going Active
Sep  9 00:19:22 USG wlb: group wan_failover, interface pppoe2 going Active

 

 

 

As you propose, i made a db repair but nothing change.  

Note, i never had db issue in the past.

 

 

> db.repairDatabase()
{ "ok" : 1 }

 

 

I have 3 controllers  / 5 sites with the same issue  ( 2 CK + 1 docker )  since this update (see msg)

 

Emerging Member
Posts: 58
Registered: ‎10-11-2015
Kudos: 10
Solutions: 1

Re: Alert On Failover And Disable Wifi On Failover

Hi @UBNT-AdamD , @UBNT-jaffe

Any news about "no more wan alert" issue ?

Thank you

Ubiquiti Employee
Posts: 576
Registered: ‎02-13-2018
Kudos: 189
Solutions: 84

Re: Alert On Failover And Disable Wifi On Failover

Going through some of the code now and it appears that firmware supported this for a while, but the alerts set to false by default in 5.8. Since this is an option in 5.9 under WAN2 to be able to change to true it should work there. 5.9.29 hit Public channels today as the stable candidate. If anyone would be willing to try that out and report back it would be helpful.

-Thanks,
Adam
Adam Dipple | UniFi Support Team
Emerging Member
Posts: 60
Registered: ‎01-14-2014
Kudos: 6

Re: Alert On Failover And Disable Wifi On Failover

Adam, can you be more specific about "going through some of the code now and it appears that firmware supported this for a while,"?

What is "this" that you are talking about? ARe you talking about my original request to disable WLANS on failover or just notifications on failover?

Thanks for your help
Ubiquiti Employee
Posts: 576
Registered: ‎02-13-2018
Kudos: 189
Solutions: 84

Re: Alert On Failover And Disable Wifi On Failover

Hi @Smarthomes,

I was talking about the notifications for gateway events that is set under the notifications settings.

Disabling the UAP/WLAN if this happens would probably be best served with the wireless uplink and connectivity monitor set it to the WAN 1 IP of the USG. If the AP is not able to contact that IP it will disable all SSIDs configured. However, this is troublesome that you want it on a certain WAP since the uplink and connectivity monitor is set per site and not per device.

Do you have a separate guest network with a separately defined IP range that the guests use on this network? You should be able to set up a policy-based routing .json file that excludes the guest network from failing over. It would just be a dead end.

https://help.ubnt.com/hc/en-us/articles/215458888-UniFi-USG-Advanced-Configuration
https://help.ubnt.com/hc/en-us/articles/360005460813-UniFi-USG-Advanced-Policy-Based-Routing-
Adam Dipple | UniFi Support Team
Emerging Member
Posts: 60
Registered: ‎01-14-2014
Kudos: 6

Re: Alert On Failover And Disable Wifi On Failover

Adam, thanks for your help. Can you confirm a few things:
1) The WAN1 IP of the USG to use for connectivity monitor would be the WAN IP that the USG pulls from the ISP? If so, and that is a dynamic IP, that could break this solution correct?
2) It is possible that the WAPs could go out over WAN 2 and get a proper response from that WAN 1 IP but if that were to happen, then WAN 1 should be up......thus not being in failover mode correct?
3) Would it be best to just create a firewall rule that prevents all traffic from Guest VLAN from going in/out of WAN 2? Is that possible? If so, customers would still connect to that WAP, their internet just wouldnt work correct?

Thanks for your help!
Ubiquiti Employee
Posts: 576
Registered: ‎02-13-2018
Kudos: 189
Solutions: 84

Re: Alert On Failover And Disable Wifi On Failover


@Smarthomes wrote:
Adam, thanks for your help. Can you confirm a few things:
1) The WAN1 IP of the USG to use for connectivity monitor would be the WAN IP that the USG pulls from the ISP? If so, and that is a dynamic IP, that could break this solution correct?
2) It is possible that the WAPs could go out over WAN 2 and get a proper response from that WAN 1 IP but if that were to happen, then WAN 1 should be up......thus not being in failover mode correct?
3) Would it be best to just create a firewall rule that prevents all traffic from Guest VLAN from going in/out of WAN 2? Is that possible? If so, customers would still connect to that WAP, their internet just wouldnt work correct?

Thanks for your help!
  1. Correct, an IP change would be problematic. When writing the post yesterday I was thinking about saying use the next-hop router but that could still be reachable while your USG WAN access is broken. (e.g. fiber cut, downed tree on cable, etc). 
  2. This is why I would use the WAN1 IP. The chances of WAN1 being down to the internet, but reachable from the LTE modem would be pretty slim, I imagine. Honestly, I know its kind of "kludgey" but at the moment I am not sure if there is something better for that. 
  3. A firewall rule isn't going to help in this situation since you're only able to block destinations and as far as the rules go, there is no delegation for which WAN the rule applies to. This is why I suggested creating a load-balancing set up where the guest network would never egress in the event of a failover. Creating and upkeep on this .json is not trivial but it would do the job until policy-based routing is implemented in the controller UI. 
Adam Dipple | UniFi Support Team
Reply