Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup an OpenVPN server which would dynamically assign clients their IP addresses from given range and I need the server to have a specific static IP address which does not lie at the start of the address range (e.g. instead of Here's my server configuration file:

mode server
port 1134
proto tcp6-server
dev tap
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
; the following line does not work :-(
keepalive 10 120
cipher AES-256-CBC
max-clients 32
verb 15
mute 10

After studying the documentation and examples on the net I thought the "ifconfig ..." line would do the trick, but openvpn keeps assigning to the virtual interface (tap0). During openvpn server initialization, this line can be seen:

Fri Apr  4 14:58:07 2014 us=410085 /sbin/ifconfig tap0 netmask mtu 1500 broadcast

Why is openvpn ignoring the "ifconfig ..." line? I don't know if it is relevant, but I use openvpn 2.3 and Ubuntu OS.

Any suggestions?

share|improve this question
up vote 1 down vote accepted

I point you to the documentation for the --server option. If you want to manually specify things do not use the --server option. Instead manually put in the directives you want. See the full man page for a listing of what --server does.

   --server network netmask
          A helper directive designed to  simplify  the  configuration  of
          OpenVPN's  server  mode.   This directive will set up an OpenVPN
          server which will allocate addresses to clients out of the given
  ->>>>   network/netmask.   The  server itself will take the ".1" address
          of the given network for use as the server-side endpoint of  the
          local TUN/TAP interface.

          For example, --server expands as follows:

               mode server
               push "topology [topology]"


               if dev tap OR (dev tun AND topology == subnet):
                 if !nopool:
                 push "route-gateway"
share|improve this answer
I use a configuration file for my server and have the exact same question. Your answer suggests that I should rewrite the assignment part in the config file (in other words, replicate the code below the ... in my config file (with the IP I want to assign). Is that correct? How does this code overwrites the default one (which also uses ifconfig, as seen in the logs) – WoJ Mar 31 at 11:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.