B Configuration for an automatic cascade start.
Original configuration can be found here:
https://github.com/ddowse/pf-tunnelactive
1 Interface Configuration (OpenVPN Client)
Select "any" as interface in the OpenVPN client. Only at the last hop "wan" interface remains.
Activate "Don't add/remove routes" everywhere except in the OpenVPN client that goes online.
Add the following line to "Custom options" and change the IP for "NEXT_VPNSERVER_IP":
route-up "/root/pf-tunnelactive/addroute.sh NEXT_VPNSERVER_IP"
Example configuration:
VPN1:
"Don't add/remove routes"
Custom options: route-up command not necessary
VPN2:
"Don't add/remove routes"
Custom options: route-up "/root/pf-tunnelactive/addroute.sh 85.17.28.145"
VPN3:
"Don't add/remove routes"
Custom options: route-up "/root/pf-tunnelactive/addroute.sh 82.199.134.162"
Screenshot_2020-11-21 pfSense localdomain - VPN OpenVPN Clients.png
Make sure that first all OpenVPN clients are running correctly (Status/OpenVPN).
Please note that Firewall Rules are strictly optional but of course NAT Rules are mandatory.
2 Firewall Floating Rules
Create a rule in “Firewall/Rules/Floating“
o Action: Block
o Interface: WAN
o Address Family: IPv4
o Protocol: Any
o Source: LAN net (For example: Local Network)
Screenshot_2020-11-21 pfSense localdomain - Firewall Rules Floating.png
3 Firewall LAN Rules
Important: Gateway configuration for LAN rules not necessary!
Screenshot_2020-11-21 pfSense localdomain - Firewall Rules LAN.png
4 NAT configuration (Firewall/NAT/Outbound)
Create a rule for each OpenVPN interface.
Last 2 rules are also important
Screenshot_2020-11-21 pfSense localdomain - Firewall NAT Outbound.png
5 Script configuration
Follow the steps under "Installation" and "Usage":
https://github.com/ddowse/pf-tunnelactive
All other steps like restarting OpenVPN clients and monitoring are done by the script.
6 Optional: Shellcmd Package
If the script works, you can add this command to Shellscript Package:
nohup php /root/pf-tunnelactive/tunnelactive.php 10 3 >> /var/log/tunnelactive.log &
After that the script will be loaded on every restart.