Multi wan and keep state problem



  • Setup: two ISP on two VLANs, ISP1 - main, ISP2 failover channel.
    use this for setup: https://doc.pfsense.org/index.php/Multi-WAN_2.0
    Problem: ISP1 down, connection estableshed through ISP2.
      ISP1 going up, connection steel through ISP2.
    For example: ping www.smg.com and see TTL
    Workaround or may be solution:
      system->advanced->misc
    Allow default gateway switching  = On
    State Killing on Gateway Failure  = Off

    In file /etc/inc/gwlb.inc
    after line: mwexec("/sbin/route change {$inetfamily} default {$gateways_arr[$dfltgwname]['gateway']}");
    add line: mwexec("/sbin/pfctl -Fs");