OpenVPN: pfSense add Static IP to config



  • 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.


  • Rebel Alliance Developer Netgate

    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)



  • 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.


Log in to reply