Dual WAN Failover doesn't failover back to WAN 1 [Resolved]
-
@pfrickroll said in Dual WAN Failover doesn't failover back to WAN 1:
How do i activate "yes"?
To make your life easier with more complex tasks like this, I would suggest enabling SSH under System > Advanced
Then use an SSH client to connect to pfSense such as Putty. When you login use the same admin credentials as you would when logging into the GUI. From the SSH terminal, use option 8 to get a shell prompt, then it's easier to follow instructions like the one above and providing inputs to prompts like the one you got.
-
@serbus
WAN_DHCP - igb0
OPT1_DHCP - igb1So, here what i see in Shell output, I am kind of lost where do I type Y or press it because I can't interact with shell window but only the command line below it
-
@Raffi_ Yes I was about to do that actually, makes sense
-
Hello!
The shell is the way to go.
You can also do a :
pkg install -y /tmp/pfSense-pkg-gatewayhook-0_1.txz
...from the gui. The "-y" will auto-yes the install...
John
-
And then...
if [ $gwname == "WAN_DHCP" ] && [ $event == "gateway.up" ] then # clear the states on this interface /sbin/pfctl -i igb1 -Fs fi
-
@serbus Looks like it worked but i have to leave now. I have to do more testing tomorrow when I get time and test IP Phone along with it and will report then.
-
Great, I'm curious to know how your testing went as well. I'll give this a try when I have some time.
-
@serbus I have a couple of questions on this. Cron is not needed to run this script?
Would this be backed up as part of the standard xml backup file or would I have to back this up with the separate Backup package? -
Hello!
The config is stored in config.xml
The plugin is event triggered. A schedule task is not needed.
The only place I have seen the plugin_gateway event generated is in the gateway group handling code. This event does not appear to be called when processing gateways that are not in a group.
John
-
@serbus I did 4 tests and it doesn't switch back to main WAN. All states are still under OPT1
By the way OPT1-igb2 actually but i fixed it in config as well.
-
Hello!
To make sure the plugin was triggered, check the system.log :
clog /var/log/system.log | grep gatewayhook
and look for something like this :
Sep 30 21:01:43 pfSenseapu4 php-fpm[404]: gatewayhook: /usr/local/etc/rc.d/rc.gateway_alarm_custom script started - WAN_DHCP gateway.down igb0 Sep 30 21:01:55 pfSenseapu4 php-fpm[405]: gatewayhook: /usr/local/etc/rc.d/rc.gateway_alarm_custom script started - WAN_DHCP gateway.up igb0
These log lines are the gatewayhook responding to a group member cable unplug/plug event.
John
-
Hello!
Also, this plugin script will not force your default gateway back to WAN_DHCP. You need to handle that with policy routing and setting the default gateway to the correct group.
John
-
@serbus I have set up routing gateways with monitoring IPs and group for failover and made firewall rules in LAN. Is there something else I have to do?
-
@pfrickroll said in Dual WAN Failover doesn't failover back to WAN 1:
Is there something else I have to do?
Hello!
Use the FO gwgroup as the default gateway in System -> Routing.
Make sure all pertinent firewall rules are using the FO gwgroup as the gateway.
Verify in Diagnostics -> Routes that the tier1 gw is the default after it comes back up.
Verify that the gatewayhook plugin is being called.
Verify that the gatewayhook script is clearing all the states on the tier2 gw.
John
-
@serbus I wiped everything on the box and started with default configurations without plugins and enabled DNS Resolver with all default configurations. It all works now but I have now new problem, IP Phones.
-
@pfrickroll said in Dual WAN Failover doesn't failover back to WAN 1 [Resolved]:
It all works now but I have now new problem, IP Phones.
I would suggest you start a new thread on this one.