[Resolved] Question on DHCP and changing pool

Samples of working configurations.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
maxburn
OpenVPN Power User
Posts: 65
Joined: Mon Dec 12, 2016 6:07 pm

[Resolved] Question on DHCP and changing pool

Post by maxburn » Wed Aug 25, 2021 2:51 pm

First of all is this even necessary? I am using CCD files for "some" clients, for the other clients that connect will DHCP issue IP addresses that are reserved in a CCD file for another client or is it smart enough to not do that?

If DHCP isn't smart enough to avoid those collisions I need to move the pool to avoid it. According to the manual
For example, --server 10.8.0.0 255.255.255.0 expands as follows:
mode server
tls-server

if dev tun:
ifconfig 10.8.0.1 10.8.0.2
ifconfig-pool 10.8.0.4 10.8.0.251
route 10.8.0.0 255.255.255.0
if client-to-client:
push "route 10.8.0.0 255.255.255.0"
else
push "route 10.8.0.1"
I am using client-to-client.

If I simply add "ifconfig-pool 10.8.0.200 10.8.0.250" to my server config I get errors that it conflicts with the already existing "server 10.8.0.0 255.255.255.0" entry in the config.

Following the example in the quote above if I change my config to look like this;

Code: Select all

;server 10.8.0.0 255.255.255.0
ifconfig 10.8.0.1 10.8.0.2
ifconfig-pool 10.8.0.200 10.8.0.250
route 10.8.0.0 255.255.255.0
push "route 10.8.0.0 255.255.255.0"
This breaks all my LAN routing to some clients, I have other route / push route statements in the config file for those clients.

Seems I'm not getting something about the explanation in that manual.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Question on DHCP and changing pool

Post by TinCanTech » Wed Aug 25, 2021 3:40 pm

You can use the 'nopool' option to --server and then specify your own pool.

maxburn
OpenVPN Power User
Posts: 65
Joined: Mon Dec 12, 2016 6:07 pm

Re: Question on DHCP and changing pool

Post by maxburn » Wed Aug 25, 2021 5:27 pm

Nice, that works great! Thanks.

Post Reply