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

Static IP's

Scheduled Pinned Locked Moved OpenVPN
6 Posts 3 Posters 1.9k 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.
  • J
    jaredadams
    last edited by Jan 31, 2014, 2:19 PM

    Simple question.  Hopefully has a simple question like a line in the client config or something…

    Can we give remote clients static ip's?

    1 Reply Last reply Reply Quote 0
    • K
      KOM
      last edited by Jan 31, 2014, 6:01 PM

      I'm no expert, but I've created several instances of pfsense + OpenVPN, and it always seems to consistently give the same IP to a user.  The IPs always seem to be 4 apart as well.  My VPN subnet was 192.168.2.0/24, and my first defined user always got 192.168.2.6, the next got 192.168.2.10, etc.  I've never seen a case where, once the IP has been assigned to a VPN user, the IP address changes.

      1 Reply Last reply Reply Quote 0
      • J
        jaredadams
        last edited by Jan 31, 2014, 8:02 PM

        This line in the log leads me to believe its possible:

        MULTI: no dynamic or static remote –ifconfig address is available for<machine name=""></machine>

        1 Reply Last reply Reply Quote 0
        • J
          jaredadams
          last edited by Jan 31, 2014, 8:14 PM

          I may be onto something

          http://michlstechblog.info/blog/openvpn-set-a-static-ip-address-for-a-client/

          But I'm having trouble locating the openvpn config file.  Where can this be found?

          1 Reply Last reply Reply Quote 0
          • J
            jaredadams
            last edited by Jan 31, 2014, 8:43 PM Jan 31, 2014, 8:33 PM

            Alrite, got this figured out….almost. Using the pfsense gui it was quite easy.  This is for those who are not comfortable using the command line.  Those comfortable with the command line easily follow these steps as well.

            1.  Install File Manager package
            2. Create the folder:

             /ect/openvpn/staticclients
            

            3. In your openvpn instance all the way at the bottom in Advanced configuration enter

            client-config-dir /etc/openvpn/staticclients
            

            4. For each client there must be a file named after it in the aforementioned folder.  No file extension.

            5.  In that file enter your static ip and subnet

            ifconfig-push <ip><subnet>Example:

            ifconfig-push 192.168.5.10 255.255.255.0
            

            6.  Connect your client.

            I can connect, however, my client is complaining about not having a gateway.  what is the syntax to add a gateway via ifconfig?

            Fri Jan 31 15:42:47 2014 OpenVPN ROUTE: OpenVPN needs a gateway parameter for a –route option and no default was specified by either --route-gateway or --ifconfig options</subnet></ip>

            1 Reply Last reply Reply Quote 0
            • P
              phil.davis
              last edited by Feb 2, 2014, 5:39 PM

              I thought you could do this in the webGUI with Client Specific Overrides - for each client certificate, specify the various settings you want to give that client, like the tunnel network you want it to use (inside the overall tunnel). Give a /30 to each client and the resulting client IP address is fixed.

              As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
              If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

              1 Reply Last reply Reply Quote 0
              6 out of 6
              • First post
                6/6
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received