I have a firewall software currently in use, however I am looking at replacing this with PfSense. I am looking to effectively replicate some of the settings on the current firewall we have in place.

The wall I have hit comes to routing hosts via a specific gateway. The current software we use has the ability to simply supply a source IP and then select the gateway that will be used. Job done, go to wimi and the change is immediate. I need to do the same thing with PfSense as I have four interfaces. 3 Wan and 1 Lan.

The 3 WAN connections have static IP's within the range of the routers they are connected to and the default gateway is WAN1. When accessing wimi.com I correctly receive the WAN IP of the WAN1 Gateway router, so this side of things is working correctly.

I need to statically route a few people through WAN2 and then WAN3 is dedicated for scripts etc (so this interface will just be a few firewall rules).

So my question is how I can specify a network IP on the LAN and set which gateway is used to connect to the internet. I can see in System->Gateways Route tab, I can add a Host (I am doing this by Alias) and then select a Gateway. When doing this however, I locked myself out fo the LAN and was unable to ping/access the PfSense gui. After disabling the rule access returned. Have I misunderstood this section and if so how do I go about achieving this.

As a note I can't say use load balancing as I need to test certain services and I must originate from a specific IP. Therefore my machine would have to be routed through WAN2 90% of the time, unless I need to switch to test another service.

Many thanks

Update Please see requested information:

Here is a collection of screenshots from the various pages. http://imgur.com/987moz3

I have two machines connected

CPE is currently the default Gateway and machines are showing the correct IP when visting wimi. I need to route my machine ( v ia the ADSL gateway, however, the ip on wimi and the tracert show the same as all other machines.

I have treble checked the NIC ip, made sure to release and renew at every change etc and close re-open cmds before executing the tracert again. I have also rebooted the pfsense server a few times.

2 Answers 2


Add a rule to your LAN interface that matches traffic coming from/going to certain hosts/nets as required and specify the outgoing gateway in that rule.

  • Forgive me for being a bit thick here. I have removed the Default Gateway rules, and have now tried to do as you said. I have clicked Firewall->Rules and added a rule under any circumstance for my pc ip and selected the WAN2 gateway and saved the rule. I have added the rule in the lan and also the floating rules separately. regardless I seem to be getting WAN1 Ip when going to wimi and also getting the WAN1 gateway ip when doing a tracert. May 8, 2014 at 14:03
  • How about just posting the rules? "added a rule under any circumstance for my PC IP" is pretty vague.
    – MikeyB
    May 8, 2014 at 14:20
  • I have updated my question with a screenshot and some info. Anything I have left out or you need to know, just let me know and I'll get it ASAP. Many thanks for your time so far. May 8, 2014 at 15:33
  • Ok so as it turns out I'm a moron. I had a squid proxy on so I was blocking all traffic to websites and the second round of testing I did was using tracert not wimi. By changing the rule to all instead of TCP/UDP it is now working. I did not spot this before, rookie mistake, many thanks for your help. May 9, 2014 at 13:35
  • Oh good. By the screenshots you posted I thought "well crap, looks right to me!"
    – MikeyB
    May 10, 2014 at 4:13

You need to create a rule under Firewall > Rules > LAN

Make the below entries;

Action > Pass

Interface > LAN

Address Family > Your Choice

Protocol > Your Choice

Source > Single Host or alias > Your Host IP

Destination > any

Click Display Advanced under Advanced Options

Scroll Down to Gateway and select your preferred Gateway to go through.

Click Save and you are ready...

  • This worked for me, but only after I changed the Protocole from any to TCP/UDP. My firewall is OPNsense 21.1 May 11, 2022 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.