Trying to set up client static IP addresses

Need help configuring your VPN? Just post here and you'll get that help.

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.
Post Reply
KNERD
OpenVpn Newbie
Posts: 5
Joined: Sat Sep 20, 2014 7:14 pm

Trying to set up client static IP addresses

Post by KNERD » Wed Jul 07, 2021 7:40 pm

I am trying to set up just one client at this point with a static IP address. Instead it keeps getting whatever dynamic IP address the server passes out to it. I have done a lot of searching and came up with the following. Any guidance on why it is failing?

Here is server.conf

Code: Select all

local 66.xx.xx.xx
port 1194
proto udp
dev tun
mode server
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
key /etc/openvpn/server.key
dh dh2048.pem
topology subnet
server 10.9.0.0 255.255.255.0
push "explicit-exit-notify 3"
push "dhcp-option DNS 1.1.1.1"

client-config-dir /etc/openvpn/ccd

user nobody
group nobody

client-to-client
#duplicate-cn
keepalive 20 60
persist-key
persist-tun
status openvpn-status.log
log    openvpn.log
comp-lzo
verb 3
/etc/openvpn/ccd/clientBH file

Code: Select all

ifconfig-push 10.9.0.14 255.255.255.0
iroute 192.168.100.0 255.255.255.0


Current /etc/openvpn/openvpn-status.log
OpenVPN CLIENT LIST
Updated,Wed Jul 7 12:37:34 2021
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
clientBH,187.156.208.113:38567,31863,5983,Wed Jul 7 12:32:34 2021
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
10.9.0.2,clientBH,187.156.208.113:38567,Wed Jul 7 12:32:35 2021
GLOBAL STATS
Max bcast/mcast queue length,0
END

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

Re: Trying to set up client static IP addresses

Post by TinCanTech » Wed Jul 07, 2021 7:44 pm

Add --ccd-exclusive to your server file.

KNERD
OpenVpn Newbie
Posts: 5
Joined: Sat Sep 20, 2014 7:14 pm

Re: Trying to set up client static IP addresses

Post by KNERD » Wed Jul 07, 2021 8:11 pm

TinCanTech wrote:
Wed Jul 07, 2021 7:44 pm
Add --ccd-exclusive to your server file.

Thanks for taking the time to respond.
Here is the output from /etc/openvpn/openvpn-status.log
OpenVPN CLIENT LIST
Updated,Wed Jul 7 13:06:57 2021
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
clientBH,187.156.208.113:34923,5402,5239,Wed Jul 7 13:06:52 2021
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
GLOBAL STATS
Max bcast/mcast queue length,0
END

KNERD
OpenVpn Newbie
Posts: 5
Joined: Sat Sep 20, 2014 7:14 pm

Re: Trying to set up client static IP addresses

Post by KNERD » Wed Jul 07, 2021 8:42 pm

I found the problem

TLS Auth Error: --client-config-dir authentication failed for common name 'clientBH' file='/etc/openvpn/ccd/clientBH'

Post Reply