Loadbalancing On Pfsense Configurations
Loadbalancing On Pfsense Configurations
Loadbalancing On Pfsense Configurations
To achieve load balancing with recursive failover in pfSense using two ISPs, you can
follow these steps. This assumes you have a basic understanding of pfSense and its
web interface:
1. Configure Interfaces:
Go to "Interfaces" in the pfSense web interface.
Assign your physical interfaces (e.g., em0 for ISP1, em1 for ISP2).
Configure the interfaces with the appropriate IP addresses from the
ISPs.
2. Configure Gateways:
Navigate to "System" -> "Routing" -> "Gateways."
Add a new gateway for ISP1:
Interface: WAN (or whichever you assigned for ISP1)
Gateway: 192.168.20.1
Add a new gateway for ISP2:
Interface: OPT1 (or whichever you assigned for ISP2)
Gateway: 192.168.10.1
3. Set Up Gateway Groups:
Go to "System" -> "Routing" -> "Gateway Groups."
Create a new gateway group, e.g., "LoadBalanceGroup."
Add both ISP1 and ISP2 gateways to this group.
4. Configure Load Balancing:
Navigate to "System" -> "Routing" -> "Gateway Groups."
Edit "LoadBalanceGroup" and set "Trigger Level" to "Packet Loss or
High Latency."
Set "Packet Loss or High Latency" to a reasonable value like 10%.
Save the changes.
5. Configure Firewall Rules:
Create or edit your LAN firewall rule to use the "LoadBalanceGroup" as
the gateway.
Go to "Firewall" -> "Rules" -> "LAN."
Edit the default rule or add a new rule with the following settings:
Action: Pass
Interface: LAN
Address Family: IPv4
Protocol: any
Source: LAN Net
Destination: any
Gateway: LoadBalanceGroup
Save the rule.
6. Enable Gateway Monitoring:
Go to "System" -> "Routing" -> "Gateways."
Edit each gateway (ISP1 and ISP2) and check the box for "Gateway
Monitoring."
Set the "Monitor IP" to 8.8.8.8.
7. Verify Failover:
Disconnect ISP1 and verify that traffic is flowing through ISP2.
Reconnect ISP1 and disconnect ISP2, and verify that traffic switches
back to ISP1.
These steps should configure pfSense for load balancing with recursive failover
between two ISPs. Make sure to test the failover scenario to ensure it works as
expected in your specific network environment. Adjustments may be needed based
on your network configuration and preferences.