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

    Set Static Internal IP for OpenVPN Clients

    Scheduled Pinned Locked Moved OpenVPN
    7 Posts 2 Posters 9.5k 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.
    • I
      ieatfish
      last edited by

      Is there a way to set static IPs for our VPN clients? The static IPs in the DHCP server are all done by MAC address but I would assume that it doesn't carry through the VPN from our remote systems. Also, our remote systems for that particular network all use the same certificate to connect.

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        Setup a client-specific override for their certificate common name/username, and assign it there. Every OpenVPN user gets a /30 carved out of the tunnel subnet specified for the VPN, so the user subnets also need to be /30's, so you can assign for example x.x.x.4/30, x.x.x.8/30, and so on.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • I
          ieatfish
          last edited by

          Why is it that each user needs 4 IPs?

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            That is how OpenVPN works in tun mode. Every user gets an interconnect subnet.

            x.x.x.y = Null route
            x.x.x.y+1 = Server IP
            x.x.x.y+2 = Client IP
            x.x.x.y+3 = Broadcast

            It's covered in the OpenVPN faq.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • I
              ieatfish
              last edited by

              @jimp:

              That is how OpenVPN works in tun mode. Every user gets an interconnect subnet.

              x.x.x.y = Null route
              x.x.x.y+1 = Server IP
              x.x.x.y+2 = Client IP
              x.x.x.y+3 = Broadcast

              It's covered in the OpenVPN faq.

              Hmm, I didn't see it explained like that in the FAQ but your answer makes perfect sense. Thanks!

              1 Reply Last reply Reply Quote 0
              • jimpJ
                jimp Rebel Alliance Developer Netgate
                last edited by

                coughcoughcough
                :-)

                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                Need help fast? Netgate Global Support!

                Do not Chat/PM for help!

                1 Reply Last reply Reply Quote 0
                • I
                  ieatfish
                  last edited by

                  @jimp:

                  coughcoughcough
                  :-)

                  OOOOHHH, I was looking in pfSense's FAQ in the OpenVPN sections…  :D Thanks for the link!

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