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

    OpenVPN client network FW rules

    Scheduled Pinned Locked Moved Firewalling
    7 Posts 4 Posters 493 Views 3 Watching
    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.
    • Z Offline
      zaitz
      last edited by

      Hello!

      I have a pfSense server with Site-to-Site setup. Everything is working as expected. Now I want to create some firewall rules witch clients can access witch resources. But it seems that pfSense sees only the incoming tunnel IP not the actual LAN address on the client? That means, that I cant configure the rules per client, but for the whole tunnel network. I'm sure, I'm missing something? Could somebody point me in the right direction?

      V bingo600B 2 Replies Last reply Reply Quote 0
      • V Offline
        viragomann @zaitz
        last edited by

        @zaitz
        This is by design of a VPN. The client connects to the server and gets an IP out of the tunnel pool. On base of this virtual IP you can set filter rules.

        That means you need to assign specific IPs to certain clients to restrict their access differently.
        This can be done with VPN > OpenVPN > Client Specific Overrides (CSO). Add a CSO for each client you want to limit with specific rule. Use the common name from the clients certificate and state a certain IP out of the tunnel pool.

        Z 1 Reply Last reply Reply Quote 0
        • bingo600B Offline
          bingo600 @zaitz
          last edited by

          @zaitz
          If you have a S2S tunnel , then you don't have "any clients" at the remote end, well technically the remote site is a client.
          But all data will flow through the S2S tunnel, with just source/dest ip's as designators.

          If you need to do rules, based on remote client data coming through the S2S tunnel, you have to give the remote site users a fixed ip.
          And create rules based on that.

          /Bingo

          If you find my answer useful - Please give the post a šŸ‘ - "thumbs up"

          pfSense+ 23.05.1 (ZFS)

          QOTOM-Q355G4 Quad Lan.
          CPUĀ  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
          LANĀ  : 4 x Intel 211, DiskĀ  : 240G SAMSUNG MZ7L3240HCHQ SSD

          1 Reply Last reply Reply Quote 0
          • planedropP Offline
            planedrop
            last edited by

            It sounds like you might not have S2S setup correctly, if it's properly S2S then the "clients" on the LAN aren't actually clients and should not have a IP related to the VPN itself. Normally the way this would work is you'd make sure the devices on one LAN have static IPs and then add rules to allow traffic from that LAN to the other site's network(s), so everything should be based on the local LAN IPs.

            1 Reply Last reply Reply Quote 0
            • Z Offline
              zaitz @viragomann
              last edited by zaitz

              @viragomann
              My tunnel network is 10.10.1.0/24 so the lan on the remote site is 10.10.66.0/24 and the traffic flows. I also setup a CSO where I have set the remote network, i'll attach a screen. Where do I set the static IP address for the tunnel?
              Now when i create a FW rule on the OpenVPN tab to block incoming 10.10.66.0/24 traffic, nothing happens, now if I edit my rule to block traffic from 10.10.1.0/24 the traffic from 10.10.66.0/24 stops.

              CSO.png

              Z 1 Reply Last reply Reply Quote 0
              • Z Offline
                zaitz @zaitz
                last edited by

                @zaitz

                I got it. If i add "ifconfig-push 10.10.1.66 255.255.255.0" to the CSO then the client will get a static IP which I can now filter!

                V 1 Reply Last reply Reply Quote 1
                • V Offline
                  viragomann @zaitz
                  last edited by

                  @zaitz said in OpenVPN client network FW rules:

                  @zaitz

                  I got it. If i add "ifconfig-push 10.10.1.66 255.255.255.0" to the CSO then the client will get a static IP which I can now filter!

                  The tunnel network field is meant for this setting.

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