Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Route specific ip's to different gateway

    Scheduled Pinned Locked Moved Routing and Multi WAN
    3 Posts 3 Posters 3.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jdetmold
      last edited by

      So I use pfsense as my default gateway, but I have a hardware vpn client at xxx.xxx.xxx.254 and need to route all traffic from specific ip's say xxx.xxx.xxx.71 to that gateway. I just have no idea how to do it. I tried creating a new gateway in system > routing > gateways pointing to xxx.xxx.xxx.254, then creating a lan firewall rule set to allow all with the new gateway. but this does not seem to work.

      I am testing by going to a whats my ip webpage. if i manually change my computers gateway to 254 it shows the vpn ip.

      any help would be great!

      1 Reply Last reply Reply Quote 0
      • T Offline
        tanman87
        last edited by

        This firewall rule… is it higher up in the list than the "Default allow LAN to any" rule?

        I've set up something similar, but with an OpenVPN client running on my pfSense box. I have a computer that is directed out the VPN connection, while everything else is going out via my normal ISP connection. My LAN rule set is something like....

        1. Source - 192.168.1.25, Dest. - Any, GW - VPN
        2. Source - LAN Net, Dest. - Any, GW - Default

        Remember that packets will be processed against the rules from the top down.

        1 Reply Last reply Reply Quote 0
        • DerelictD Offline
          Derelict LAYER 8 Netgate
          last edited by

          That's going to be problematic because you'd need to route traffic out the same interface it came in on.

          If you have, say:

          192.168.1.1/24 pfSense LAN
          192.168.1.25 Host
          192.168.1.254 VPN device

          If you set the default gateway on 192.168.1.25 to 192.168.1.1, then make a rule on LAN sending traffic from 192.168.1.25 to 192.168.1.254 it's going to get weird.

          Why not just set the default gateway of the host to 192.168.1.254 if that's how you want it to behave anyway?  Then there's almost no possibility of leakage.

          What does the VPN device do that pfSense can't do itself?

          Chattanooga, Tennessee, USA
          A comprehensive network diagram is worth 10,000 words and 15 conference calls.
          DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
          Do Not Chat For Help! NO_WAN_EGRESS(TM)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.