OpenVPN - how to set static IP address for clients?

Discussion in 'Tomato Firmware' started by Jason404, Mar 18, 2012.

  1. Jason404

    Jason404 Addicted to LI Member

    How would I force an OpenVPN client to have a particular IP address?

    I am connecting a could-based replica DC through OpenVPN, so I need to make sure that it always has the same IP address (

  2. EOC_Jason

    EOC_Jason Networkin' Nut Member

    IP addresses for machines are handled by local DHCP servers, so that is what you would need to configure. The OpenVPN link would be (mostly) transparent as all it provides is an alternate route for traffic.
  3. Jason404

    Jason404 Addicted to LI Member

    The OpenVPN subnet for this connection is The DC client has been assigned and ipconfig /all says that the DHCP server has the address I assume this is within the Tomato OpenVPN server (, OpenVPN interface -
  4. Jason404

    Jason404 Addicted to LI Member

    When using standalone OpenVPN (not integrated into Tomato), there is a directive:

    client-config-dir /etc/openvpn/ccd

    ..and in the CCD directory, you the comatined client files can have this to set a static IP address:

    for Windows Clients:
    #ifconfig-push clientIP serverIP
    for Linux Clients:
    #ifconfig-push clientIP Netmask

    How do I do this in the OpenVPN server config on Tomato? Does it go in Custom Configuration somehow?
  5. Jason404

    Jason404 Addicted to LI Member

    If anybody else wants to know how to do this, you simply add the usual configuration directives in the Custom Configuration section:

    client-config-dir /cifs1/CCD

    ...and then have a file named the same as the client Common Name in the cifs/jffs share with the IP address and subnet mask:

  6. occamsrazor

    occamsrazor Network Guru Member

    Maybe I'm misunderstanding something.... but can't you just set a static DHCP IP using the normal Tomato router functions based on the MAC address of the remote client's OpenVPN interface? That's what I've done in the past - just got the remote client to connect, find its entry in the Device List, then just assign that MAC a static DHCP address. I guess perhaps your setup is more complicated....
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice