Seeming simple but how to: Multiple WAN and LANs
-
I have 2 LANs into a PFSense box. Now I wish to setup LAN 1 to go to WAN 1 interface and the other LAN 2 to go out another WAN (2) interface. When I try to set the gateway on the LAN 2 to the IP of the WAN 2 gateway, it says it must be in the same subnet as LAN 2 or if I leave gateway empty it routes through WAN 1. How do I route all traffic out of LAN 2 to WAN 2?
-
Well for one you never put a gateway on the actual "lan" interface. You just setup rule on the firewall for lan2 to use your wan2 gateway, and rule on your lan1 interface to use wan1 gateway.
https://doc.pfsense.org/index.php/Multi-WAN_2.0
-
I am trying to do exactly the same as you, I have found a work-round for the subnet but I still can't get it to work correctly.
Have you managed too?
-
In pfSense/FreeBSD (like other OSes I can think of), a gateway is the IP address of another box to which the computer can send data packets destined for some group of other IP subnets (or for all). The interfaces that have gateways are dealt with as WAN-type, the gateway is supposed to be on that WAN subnet on a different machine (ISPs router, some other box on the way to the internet.
Define a gateway on each WAN pointing to the upstream IP address of the path to the internet.
Remove any gateways from LAN.
Set whichever WAN gateway you prefer to be the default route.
Add policy-routing rules (rules that pass traffic and send it into a gateway).
On LAN1: Pass protocol any source LAN1net destination any gateway WAN1GW
On LAN2: Pass protocol any source LAN2net destination any gateway WAN2GWIf you want failover, then make gateway groups with the required order of preference and feed the traffic into the gateway groups.