Hi,
I'm setting up an openvpn server and would like the service to dynamically assign IP addresses to connecting clients except for those in client-config-dir.
I started out with this openvpn config:
proto tcp-server
dev tun144
[...]
server 192.168.144.0 255.255.252.0
[...]
client-config-dir /etc/openvpn/ccd
# cat ccd/client3
ifconfig-push 192.168.147.49 192.168.147.50
Now suppose that client1 connects and it's common name/user name isn't in client-config-dir. Will OpenVPN make sure NOT to give out the IP address I specified in ccd/client3?
I know the IP pool is big and openvpn will start handing out from the start so I probably won't have any collisions unless MANY clients connect. Still, it's a general question:
does openvpn take into account the "static"/manual IP address assignments in client-config-dir?
I suspect it doesn't so then I tried a different configuration and it seems to work fine.
proto tcp-server
dev tun144
[...]
mode server
tls-server
ifconfig 192.168.144.1 192.168.144.2
ifconfig-pool 192.168.144.4 192.168.144.251
route 192.168.144.0 255.255.252.0
push "route 192.168.144.1"
client-config-dir /etc/openvpn/ccd
The network mask is /22 while the IP address pool is a lot smaller. So in this case, openvpn will serve dynamic IP addresses within 192.168.144.4-192.168.144.251 and "known clients" identified within client-config-dir will get static addresses within the range 192.168.145.1-192.168.147.254 (manually set).
Is this how it's supposed to be done?
Vieri