openvpn - ifconfig parameter
From OpenVPNs own documentation:
# 10.1.0.2 is our local VPN endpoint (home).
# 10.1.0.1 is our remote VPN endpoint (office).
ifconfig 10.1.0.2 10.1.0.1
In other words this is when you want your VPN clients to assign their own VPN IP address.
The client will in my example have the IP address 10.1.0.2
and the VPN gateway will have the IP address 10.1.0.1
.
Found it on my Ubuntu server under
/usr/share/doc/openvpn/examples/sample-config-files/static-home.conf
The alternative is using client-config-dir <path>
in OpenVPN servers master file and let all clients connect to the server using a client certificate with unique CommonName in the certificate.
Lets say you have setup client-config-dir
to point to the subdirectory ccd
.
You can then create a file with a name matching the CommonName in each client certificate that contains the line ifconfig-push <IP address> <subnet mask>
. Using my example above:
ifconfig-push 10.1.0.2 255.255.255.0
This assumes you have a line in the servers master config file that contains the line:
server 10.1.0.0 255.255.255.0
Related videos on Youtube
![umar14](https://i.stack.imgur.com/p0Nvz.jpg?s=256&g=1)
umar14
Electronics and Programming Enthusiast I program in Python / Bash / C and work as a Radar Engineer maintaining a Linux server. I can write applications and scripts in Python, do server administration and write firmware for microcontrollers. I am also an active Freelancer on Fiverr
Updated on September 18, 2022Comments
-
umar14 almost 2 years
What does
ifconfig
parameter in openvpn configuration file mean? Here is an example file:dev tun0 proto udp comp-lzo port 5073 remote 172.16.23.73 5073 ifconfig 172.17.3.41 172.17.3.43
-
umar14 over 4 yearsThank you for explaining this!