How to specify DHCP Range in Config File CentOS
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
-
- OpenVpn Newbie
- Posts: 1
- Joined: Mon Jun 10, 2013 2:17 pm
How to specify DHCP Range in Config File CentOS
What is the proper way to specify the DHCP Range to clients? Server configuration file (openvpn.conf)
-
- OpenVPN Super User
- Posts: 219
- Joined: Mon Nov 23, 2009 8:24 pm
Re: How to specify DHCP Range in Config File CentOS
Yes, that's the way to do so:
--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 end‐
point of the local TUN/TAP interface.
For example, --server 10.8.0.0 255.255.255.0 expands as follows:
- janjust
- Forum Team
- Posts: 2703
- Joined: Fri Aug 20, 2010 2:57 pm
- Location: Amsterdam
- Contact:
Re: How to specify DHCP Range in Config File CentOS
if you want to specify a different range then replace the
it's the 'ifconfig-pool' that specifies the DHCP IP range. It's also possible to specify ranges outside of the server VPN IP, but in that case routing becomes trickier.
statement withdev tun
server 10.8.0.0 255.255.255.0
Code: Select all
mode server
tls-server
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
push "route 10.8.0.0 255.255.255.0"
push "route 10.8.0.1"