@scarpy:
Thanks very much for BACKUP function on PFSense!! ;D
I'd like to modify Raja's monitor-gw script to add this function to my PFsense box:
When monitor-gw script changes the default gateway,
i want it to change the 1:1 NAT rules for my PCs
In other words:
I need to NAT my LAN IP addresses in different ways depending on which is the
default gateway at the moment.
Some details:
My LAN is 10.0.0.0/24 with static IPs.
My WAN1 is 192.168.1.0/24 (PFSense NIC is 192.168.1.1)
My WAN2 is 192.168.2.0/24 (PFSense NIC is 192.168.2.1)
My default wan is WAN1.
I want to use NAT to change each LAN ip from 10.0.0.x to 192.168.1.x.
When my default wan (WAN1) is down, PFSense must use WAN2 and must nat each ip
from 10.0.0.x to 192.168.2.x
Thanks in advance for any help.
Bye,
Alex
you can do that 2 ways a hard one and a simpel one
the hard one you need to edit the rules.debug file on the fly from the monitor script and chanche the wan interface there to the one that is active
the simpel way is to copy the rules.debug file to 2 files
/tmp/wan1.rules and /tmp/wan2.rules
edit the wan="interface" line in both files to the correct interface
let the script afther chancing the wan interface
the correct rules file run
pfctl -f /tmp/wan1.rules
for wan1
pfctl -f /tmp/wan2.rules
for wan2