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

    Communicate with an OpenVPN Client from behind the LAN

    Scheduled Pinned Locked Moved OpenVPN
    14 Posts 2 Posters 2.0k 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.
    • H
      Heli0s
      last edited by

      If I have an OpenVPN client connecting to my pfSense OpenVPN server. They're able to talk to the LAN on the ports/IPs that I allow. Can I also setup a communication in reverse (have the LAN client talk back to the OpenVPN client)?

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

        Should be pretty much automatic if the rules on LAN (and the client) allow the traffic.

        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
        • H
          Heli0s
          last edited by

          So I need an allow to OpenVPN rule on my LAN and use an OpenVPN address (the one from the server pool) when connecting to an OpenVPN client?

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

            I'm connected right now.  From my LAN I can ping my client connected to the remote access server.  There is probably a way to use client-specific settings to set static IPs if necessary.

            All you need to do on LAN is be sure traffic from LAN net to the OpenVPN tunnel network (or specific host or whatever) is allowed.  The default pass any rule would suffice.

            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
            • H
              Heli0s
              last edited by

              Is there a way to setup static IPs to OpenVPN clients and add those IPs to the DNS Forwarder?

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

                Don't see why not but it would probably be a two-step process.  I don't think there's a hook from OpenVPN into dnsmasq.

                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
                • DerelictD
                  Derelict LAYER 8 Netgate
                  last edited by

                  My tunnel network is 172.29.64.0/24.  I just added this to my client-specific override and it worked fine:

                  ifconfig-push 172.29.64.100 255.255.255.0;

                  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
                  • H
                    Heli0s
                    last edited by

                    How does the OpenVPN Server know which client should get which IP address?

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

                      The common name in the certificate used to connect references the common name in a client-specific override which contains the ifconfig-push command.

                      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
                      • H
                        Heli0s
                        last edited by

                        Completely missed that tab. Thanks! I do have two more quests:

                        1. Is it possible to see when a client connects and what clients are currently connected?
                        2. If I want to take away a client's access, do I just remove their cert or is there something else I need to do?
                        1 Reply Last reply Reply Quote 0
                        • DerelictD
                          Derelict LAYER 8 Netgate
                          last edited by

                          @Heli0s:

                          Completely missed that tab. Thanks! I do have two more quests:

                          1. Is it possible to see when a client connects and what clients are currently connected?

                          Status->OpenVPN?

                          There's also a dashboard widget I think.

                          1. If I want to take away a client's access, do I just remove their cert or is there something else I need to do?

                          Without requiring a username and password (which you could temporarily disable or change)  I'm pretty sure you're limited to revoking the cert and using a CRL.  System->Cert Manager Certificate Revocation.  You'll want to be sure OpenVPN is properly honoring the CRL by thoroughly testing.

                          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
                          • H
                            Heli0s
                            last edited by

                            So my server is 10.10.0.0/24 and I've added the following line to the client override: ifconfig-push 10.10.0.10 255.255.255.0;

                            But I'm getting the following error: ifconfig addresses are not in the same /30 subnet

                            1 Reply Last reply Reply Quote 0
                            • H
                              Heli0s
                              last edited by

                              Never mind. Apparently, you need to check the "Allocate only one IP per client (topology subnet), rather than an isolated subnet per client (topology net30)." checkbox in the server for this to work.

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

                                Or you need to statically assign based on topology net30.  I think it's something like ifconfig-push 10.10.0.9 10.10.0.10.

                                But if topology subnet works it's the preferred mode.  net30 is being deprecated I think.

                                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.