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

    Is it possible to use the VPN on the same LAN network as the OpenVPN server?

    Scheduled Pinned Locked Moved OpenVPN
    7 Posts 4 Posters 703 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.
    • ?
      A Former User
      last edited by

      Hi!, I have an OpenVPN server configured to connect remotely to a server and it works correctly but I frequently have to go to the site where the server is located and to work with the server I do it through the LAN. The problem is that if I forget to disconnect my computer from The VPN, when connected to the LAN, there is a conflict that prevents me from connecting to the server and I have the feeling that the speed of the Internet connection drops.

      This is easily solved by disconnecting the VPN from my computer, but I would like to know if there is an option so that it is not necessary to disconnect the VPN to connect to the server, in other words that the VPN functions on the same network as the OpenVPN server. Thank you!.

      V 1 Reply Last reply Reply Quote 0
      • V
        viragomann @A Former User
        last edited by

        @ErickJ
        Connect to the OpenVPN server from inside the LAN makes no sense at all anyway. So I would block access to the server from LAN. Then your client is not able to reconnect and LAN access should work normally.

        This means, add a reject rule to the LAN interface for the proper protocol you use for OpenVPN, with destination "This firewall" and the OpenVPN server port.

        J JKnottJ 2 Replies Last reply Reply Quote 0
        • ?
          A Former User
          last edited by

          Thank you!, yes of course I know it doesn't make any sense but I find it somewhat annoying to forget to disconnect the VPN and have those problems.

          1 Reply Last reply Reply Quote 0
          • J
            Jarhead @viragomann
            last edited by

            @viragomann said in Is it possible to use the VPN on the same LAN network as the OpenVPN server?:

            @ErickJ
            Connect to the OpenVPN server from inside the LAN makes no sense at all anyway. So I would block access to the server from LAN. Then your client is not able to reconnect and LAN access should work normally.

            This means, add a reject rule to the LAN interface for the proper protocol you use for OpenVPN, with destination "This firewall" and the OpenVPN server port.

            Are you sure about this?
            Tried that a while back and it didn't disconnect the VPN, which caused all traffic to drop. It would work if you tried to establish a connection from the LAN, but in a case where you were already connected on mobile, then it switched to wifi it didn't work.
            Maybe I missed a setting somewhere?

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

              @Jarhead
              No, didn't try it to be honest.
              I was expecting that, since pfSense has no state for the VPN on the LAN, the connection would be dropped and the client needs to reconnect. But you say, it isn't?

              J 1 Reply Last reply Reply Quote 0
              • J
                Jarhead @viragomann
                last edited by Jarhead

                @viragomann I actually just tried it again a little while ago, didn't work.
                It does work in the form of rejecting the traffic, ie the rule works, but the problem is since the vpn was already connected , ie on mobile with no wifi connected, the routes were already in place to use the vpn. Then when it connects to the wifi, I'm guessing those routes don't get flushed, but the vpn does get rejected which kills all traffic from the phone.
                I wonder if there's a "flush routes on reconnect" option in OpenVPN??
                Gonna Google now.

                1 Reply Last reply Reply Quote 0
                • JKnottJ
                  JKnott @viragomann
                  last edited by

                  @viragomann said in Is it possible to use the VPN on the same LAN network as the OpenVPN server?:

                  Connect to the OpenVPN server from inside the LAN makes no sense at all anyway.

                  But it does work, at least here it does. However, that would depend on how you configure the server and what interfaces it listens to. Since I wanted to be able to connect via both IPv4 and IPv6, I had to choose the multihome connection.

                  PfSense running on Qotom mini PC
                  i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                  UniFi AC-Lite access point

                  I haven't lost my mind. It's around here...somewhere...

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