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

    OpenVPN: pfSense add Static IP to config

    Scheduled Pinned Locked Moved OpenVPN
    3 Posts 3 Posters 3.7k 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.
    • U
      uros
      last edited by

      Hi!

      We have very strange behaviour of OpenVPN on pfSense (2.3.4). OpenVPN is configured for Site-to-Site VPN and for convinience we use static IP for our VPN Clients so we used Client Specific Overrides and at the end in Advanced we put:
      ifconfig-push 10.0.1.6 255.255.255.0

      After client connection, client gets IP 10.0.1.0 instead of 10.0.1.6?!!!? We found out, that pfSense adds additional line into VPN Config for most of clients config - yes, MOST of, but not ALL of them!

      Here is example of this added config copied from:
      /var/etc/openvpn-csc/server1

      push "route 192.168.178.0 255.255.255.0"
      iroute 172.16.5.0 255.255.255.0
      push "dhcp-option DNS 192.168.178.10"
      push "dhcp-option DNS 8.8.8.8"
      push "redirect-gateway def1"
      ifconfig-push 10.0.1.6 255.255.255.0
      ifconfig-push 10.0.1.0 255.255.255.0 - EXTRA LINE ADDED BY pfSENSE

      Any suggestion how to solve this strange behaviour?

      Regards,
      Uros.

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

        The "tunnel network" field of an override sets up ifconfig-push.

        Put your assignments there, or leave it blank and use your advanced option.

        Do not just copy the server tunnel network into the override, it will not do what you want. Put the real client address there (e.g. 10.0.1.6/24 in your example)

        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
        • R
          robatwork
          last edited by

          I was struggling with this for a while and nothing i did in "advanced" on the server itself worked.
          In client specific overrides I chose the correct server, put in the common name from the certificate, and chose tunnel network of 192.168.68.6/24

          Now the first (and in my case only) VPN client always gets 192.168.68.6

          In the server the tunnel is 192.168.68.0/24.

          I know that's what Jim said but I am spelling it out so that future googlers (including me probably!) can find it in a more idiot proof form.

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