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

    Choose gateway depending of destination ip/url

    Scheduled Pinned Locked Moved OpenVPN
    4 Posts 2 Posters 466 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.
    • S
      senselessnewb
      last edited by

      I've setup my VPN using these instructions and it's working great.
      https://protonvpn.com/support/pfsense-openvpn/

      I couldn't watch iplayer or dazn on my tv so I made an alias for my tv's IP and created a firewall rule. The rule's source is set to the TV's alias and the gateway set to my WAN gateway. Hey-presto, everything from the tv goes through WAN (so I can watch iplayer and dazn) and every other device in my home goes through the VPN.

      The only time I don't want to use the VPN on my computer is when I'm playing a particular online computer game. I've been testing how I can do this per destination instead of source by trying to make any traffic that goes to whatismyip.com, or the IP that shows up when I ping it, to go through the WAN gateway instead of the VPN gateway. It never works. It always continues to go through the VPN.

      Is what I'm attempting possible? I certainly seem to be able to block 'whatismyip.com' using that destination field but I can't get it to use the WAN gateway insted of the VPN gateway.

      Thanks for any help

      V 1 Reply Last reply Reply Quote 0
      • V
        viragomann @senselessnewb
        last edited by

        @senselessnewb
        Using IP or an alias as the destination of a policy routing rule works in the same way basically.

        Remember to put the policy routing rule to the top of the rule set, so that it is applied before the subnet rule is probed.

        Also consider to flush existing states.

        1 Reply Last reply Reply Quote 0
        • S
          senselessnewb
          last edited by

          Thank you - I still can't get it to work but at least I know it's possible now! I wasn't sure if I was 'floggin' a dead horse!'

          The only bit I'm not 100% on is 'flush existing states'... does refreshing/restarting openVPN do this?

          Thanks

          V 1 Reply Last reply Reply Quote 0
          • V
            viragomann @senselessnewb
            last edited by

            @senselessnewb
            Diagnostics > States > States
            You can filter the list for a specific IP (TV) and flush only these.

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