Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    OpenVPN client IPs see each other

    Scheduled Pinned Locked Moved OpenVPN
    13 Posts 4 Posters 4.7k Views 4 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.
    • S Offline
      sgw
      last edited by

      Forgive me for maybe asking an FAQ, I am in a hurry right now.

      At a customer I run an OpenVPN server instance with maybe 30-40 parallel clients.

      The server is configured to allow 64, that's enough.

      Today the admin of my customer had to debug some printer issue on a VPN client, and ran an IP scan on that PC.

      And the scanner found and listed all the other OpenVPN clients in the Tunnel Network ... That's maybe expected, but unwanted ...

      The checkbox "Inter-client communication" is disabled.
      How to quickly and safely change this?

      Add a firewall rule to the OpenVPN interface rejecting ICMP, for example?

      This is production, I better ask before I ruin more.
      Thanks for any pointers!

      S GertjanG 2 Replies Last reply Reply Quote 0
      • S Online
        slu @sgw
        last edited by slu

        @sgw said in OpenVPN client IPs see each other:

        That's maybe expected, but unwanted ...

        This is not expected, is it a tun or tap OpenVPN and how look the firewall rules on OpenVPN?

        pfSense Gold subscription

        1 Reply Last reply Reply Quote 0
        • GertjanG Offline
          Gertjan @sgw
          last edited by Gertjan

          @sgw

          if the VPN client is a Microsoft device, this choice does what you want it to do

          1d6bd2a1-97b2-4417-9f1d-71072d666b3d-image.png

          (sorry, for some reason my version wants to talk french to me)

          Pick the 'public network' (Recommanded !).
          From then on, the PC will use it's own IP, and the gateway IP (the open VN server) and allows nothing 'to' and 'from' elsewhere.
          You might be able to ping something else, I'm not sure. Afaik, ping is harmless.

          Btw, funny actually, on any other wired or not network segment, you would be able to harass any other device in that 'LAN' segment and pfSense won't be able to stop that.
          VPN is different, as I resume it's an end to end point connection, so maybe you can enforce what you want with a pfSense OpenVPN server firewall rule.
          Instead of the open bar style of VPN firewalling - the one I use :

          7e5114bc-6d42-45dc-8b59-b90f2726b2ca-image.png

          use / try :

          0a39532a-1abc-4203-a7f0-87a212757ea1-image.png

          No "help me" PM's please. Use the forum, the community will thank you.

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sgw @Gertjan
            last edited by

            @Gertjan thank you.
            I will only have time and brains to look into that tomorrow.
            I have to map what "PORTAL subnets" and "VPN subnets" mean in my context.

            Ah, btw: most of the clients are pfSenses also, as VPN-gateways on the sites of the customers of my customer ;-)

            In my case the Tunnel Network is 172.31.0.0/23 and for example a client 172.31.0.16 should be able to access one particular VM in a local net like 172.31.110.60 only.

            And pinging or accessing something like 172.31.0.17 (= other openvpn client) or 172.31.110.61 (=other server VM) should be disabled.

            When I write this it sounds to me as if I have to write one rule per ovpn-client, to only allow access (RDP, to be exactly, and maybe ICMP) to his related server-VM-IP.

            This relates to one of my earlier postings: I had assumed that I could limit access by setting "IPv4 Local Network/s" in the ovpn-CSC/CSO. But as I learned this only relates to the routing table entry created. It doesn't block anything ...

            thanks so far, I have to get afk now. busy day.

            GertjanG 1 Reply Last reply Reply Quote 0
            • M Offline
              MalagaFirewall8
              last edited by

              I would solve this on the OpenVPN firewall rules, not with the CSO "local network" field. That field only decides what routes get pushed/installed; it is not an ACL.

              For production I would make it explicit: pass rules first for each client tunnel IP/alias to only its allowed VM and port(s), for example 172.31.0.16 -> 172.31.110.60 TCP/3389 plus ICMP if you need it. Then add a reject/block rule below for source 172.31.0.0/23 to destination 172.31.0.0/23 and to the local server subnets you do not want reachable. The rule order matters, so test with one client before copying it to the rest.

              S 1 Reply Last reply Reply Quote 1
              • GertjanG Offline
                Gertjan @sgw
                last edited by Gertjan

                @sgw said in OpenVPN client IPs see each other:

                I have to map what "PORTAL subnets" and "VPN subnets" mean in my context.

                Me being not careful. The "PORTAL Subnets" alias doesn't belong here. It should be "VPNS Subnets" (my VPN Server interface).
                It should be :

                b9579b6a-8d07-4dc6-bdc4-03937869eea3-image.png

                edit :

                When firewall rules are created for every (VPN) user, you beter make sure that every known VPN user (device) gets it's own 'static' (== the same tunnel IP) every time it connects.

                I've played with this a bit a while ago, and there are forum posts about it in this forum (OpenVPN).
                Search with "Client Specific Overrides".
                An example :

                50b97f4f-cfbb-4d4b-bd4e-7a14db07c9f5-image.png

                My iPad, - and I selected my OpenVPN server from the list.
                The common name of the certificate used is "iPad-Gertjan". I used only certificates = "Remote Access (SSL/TLS)".
                Entered the Tunnel network
                and at the bottom :
                f9106d1f-fe3a-4526-8ad5-460c35fa1fa6-image.png

                where I assign 192.168.3.10 to my iPad every time it connects.

                No "help me" PM's please. Use the forum, the community will thank you.

                1 Reply Last reply Reply Quote 0
                • S Offline
                  sgw @MalagaFirewall8
                  last edited by

                  @MalagaFirewall8 said in OpenVPN client IPs see each other:

                  I would solve this on the OpenVPN firewall rules, not with the CSO "local network" field. That field only decides what routes get pushed/installed; it is not an ACL.

                  It would be a great feature if an ACL would be created out of these CSO-configs.
                  Very helpful: I'd have every client plus its target-VM-IP in one place.

                  For production I would make it explicit: pass rules first for each client tunnel IP/alias to only its allowed VM and port(s), for example 172.31.0.16 -> 172.31.110.60 TCP/3389 plus ICMP if you need it. Then add a reject/block rule below for source 172.31.0.0/23 to destination 172.31.0.0/23 and to the local server subnets you do not want reachable. The rule order matters, so test with one client before copying it to the rest.

                  I will test this out with a test user asap. Thanks.
                  I have to come up with a rather compact ruleset, as I have to create rules for all the already existing clients.

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sgw @sgw
                    last edited by

                    My tests look promising:

                    I set up a tunnel-user with static Tunnel-IP 172.31.0.79/23, and created an alias for that IP (maybe overkill, the alias can only be used in the FW-rules, not in the CSC, afaik. That's more for readability maybe, unsure so far).

                    I then created 3 test-rules on the OpenVPN interface:

                    pass IPv4 TCP/UDP from that tunnelip to the server-IP, Port 3389 (RDP)
                    pass IPv4 ICMP from that tunnelip to the server-IP
                    block IPv4 ANY from that tunnelip to the Tunnel Network of that OpenVPN server

                    (like @MalagaFirewall8 suggested)

                    Tests with nmap work as expected.

                    If I modify the last rule to "from Tunnel Network to Tunnel Network" my main issue would already be resolved (all openvpn client Tunnel IPs don't see each other anymore).

                    btw: what about the connection to the IP of the pfSense in that network? doesn't ping, OK, but the tunnel works, ok so far.

                    My secondary goal to only allow Client X to connect to Server Y needs at least one allow-rule for RDP, better a second for ICMP to help the support guys testing connectivity now and then.

                    All that sounds like scripting in in Ansible ( https://github.com/pfsensible/core/wiki/pfsense_rule etc) but I have to check which approach is faster. Will discuss that with their tech guys etc

                    But the direction seems clear. Thanks all!

                    S 1 Reply Last reply Reply Quote 0
                    • S Online
                      slu @sgw
                      last edited by

                      @sgw if you have only this two pass rules another block rules is not needed, because blocking is the default...

                      pfSense Gold subscription

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sgw @slu
                        last edited by

                        @slu said in OpenVPN client IPs see each other:

                        @sgw if you have only this two pass rules another block rules is not needed, because blocking is the default...

                        yes, sure. But currently there is an allow-all rule at the end ... not good.
                        But I won't touch too much right now with active users during the day.

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          MalagaFirewall8
                          last edited by

                          That sounds like the right direction. I’d keep the final broad block/reject while you still have the old allow-all rule around, mostly because it makes mistakes visible in the rule counters/logs. Once the per-client pass rules are complete and the allow-all is gone, the implicit deny can do the same job. For rollout, aliases per static tunnel IP are not wasted if they make the rule set readable for the next person.

                          S 1 Reply Last reply Reply Quote 0
                          • S Offline
                            sgw @MalagaFirewall8
                            last edited by

                            @MalagaFirewall8 thanks. I will take these into the discussions with my customer next week.

                            S 1 Reply Last reply Reply Quote 0
                            • S Offline
                              sgw @sgw
                              last edited by sgw

                              I plan to generate aliases and fw-rules via pfsensible ... at first I asked the customer to set fix tunnel IPs via CSOs and then give me a list of "tunnel-IP; target VM IP". From that I will try to write some playbook.
                              There are also VMs with more than only RDP: postgres-DBs etc ... so that adds up to more complexity.
                              AND customers with multiple tunnels.

                              The fun has no end ;-)

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