[solved] Two clients got the same IP
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: 5
- Joined: Fri Jan 07, 2011 1:47 pm
[solved] Two clients got the same IP
Hello,
Here is my problem:
When connecting to my OpenVPN server, my client gets the IP 10.8.0.6.
Next a friend of mine connects and gets IP 10.8.0.10.
So far, there aren't any problems.
But there are clients, which get an IP which was already given to a client which is still connected.
e.g.
First client connects and gets IP 10.8.0.6.
Second client connects and gets IP 10.8.0.6 too, although first client is still connected.
Why do two clients got the same IP? Can somebody please help me?
Kind regards,
Markus
# Server Config
port 1194
proto udp
dev tun
dev-node OpenVPN
ca .\\..\\easy-rsa\\keys\\ca.crt
cert .\\..\\easy-rsa\\keys\\server.crt
key .\\..\\easy-rsa\\keys\\server.key
dh .\\..\\easy-rsa\\keys\\dh1024.pem
server 10.8.0.0 255.255.255.0
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 6
# Client 01 Config (each client has unique *.crt and *.key file)
client
dev tun
dev-node OpenVPN
proto udp
remote myserver.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca .\\..\\easy-rsa\\keys\\ca.crt
cert .\\..\\easy-rsa\\keys\\client_01.crt
key .\\..\\easy-rsa\\keys\\client_01.key
ns-cert-type server
comp-lzo
verb 6
Here is my problem:
When connecting to my OpenVPN server, my client gets the IP 10.8.0.6.
Next a friend of mine connects and gets IP 10.8.0.10.
So far, there aren't any problems.
But there are clients, which get an IP which was already given to a client which is still connected.
e.g.
First client connects and gets IP 10.8.0.6.
Second client connects and gets IP 10.8.0.6 too, although first client is still connected.
Why do two clients got the same IP? Can somebody please help me?
Kind regards,
Markus
# Server Config
port 1194
proto udp
dev tun
dev-node OpenVPN
ca .\\..\\easy-rsa\\keys\\ca.crt
cert .\\..\\easy-rsa\\keys\\server.crt
key .\\..\\easy-rsa\\keys\\server.key
dh .\\..\\easy-rsa\\keys\\dh1024.pem
server 10.8.0.0 255.255.255.0
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 6
# Client 01 Config (each client has unique *.crt and *.key file)
client
dev tun
dev-node OpenVPN
proto udp
remote myserver.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca .\\..\\easy-rsa\\keys\\ca.crt
cert .\\..\\easy-rsa\\keys\\client_01.crt
key .\\..\\easy-rsa\\keys\\client_01.key
ns-cert-type server
comp-lzo
verb 6
- gladiatr72
- Forum Team
- Posts: 194
- Joined: Mon Dec 13, 2010 3:51 pm
- Location: Lawrence, KS
Re: Two clients got the same IP
What does the contents of your ipp.txt file look like?
-Stephen
-Stephen
[..]I used to think it was awful that life was so unfair. [...]Wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? -Marcus Cole
-
- OpenVpn Newbie
- Posts: 5
- Joined: Fri Jan 07, 2011 1:47 pm
Re: Two clients got the same IP
Hi Stephen,
I'm not using an IPP.txt File.
Do I have to?
Markus
I'm not using an IPP.txt File.
Do I have to?
Markus
- gladiatr72
- Forum Team
- Posts: 194
- Joined: Mon Dec 13, 2010 3:51 pm
- Location: Lawrence, KS
Re: Two clients got the same IP
Have to... have to... Yeah. I'm gonna say that you really do. Just add the following to your server.conf and restart openvpn:
All this does is is maintain a file (called ipp.txt in this case) that maps the cn of your client cert to an IP on your VPN network. I can almost guarantee this is the cause of your address collision problem.
-S
Code: Select all
ifconfig-pool-persist ipp.txt
-S
[..]I used to think it was awful that life was so unfair. [...]Wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? -Marcus Cole
-
- OpenVpn Newbie
- Posts: 5
- Joined: Fri Jan 07, 2011 1:47 pm
Re: Two clients got the same IP
Hi Stephen,
OK, now an ipp.txt is created after I restarted the server -> content: <server hostname>, 10.8.0.4.
Then I connected with two clients -> both got IP 10.8.0.6; ipp.txt wasn't updated.
Markus
OK, now an ipp.txt is created after I restarted the server -> content: <server hostname>, 10.8.0.4.
Then I connected with two clients -> both got IP 10.8.0.6; ipp.txt wasn't updated.
Markus
- gladiatr72
- Forum Team
- Posts: 194
- Joined: Mon Dec 13, 2010 3:51 pm
- Location: Lawrence, KS
Re: Two clients got the same IP
Heya,
Please set verb 4 in server.conf and one of your client.conf files, restart the server, then reconnect the clients then post the logs from the server and one client.
-Stephen
Please set verb 4 in server.conf and one of your client.conf files, restart the server, then reconnect the clients then post the logs from the server and one client.
-Stephen
[..]I used to think it was awful that life was so unfair. [...]Wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? -Marcus Cole
-
- OpenVpn Newbie
- Posts: 5
- Joined: Fri Jan 07, 2011 1:47 pm
Re: Two clients got the same IP
Hi Stephan,
I'm not allowed to attach files - what can I do? I didn't find help in forum FAQ.
Markus
I'm not allowed to attach files - what can I do? I didn't find help in forum FAQ.
Markus
-
- OpenVpn Newbie
- Posts: 5
- Joined: Fri Jan 07, 2011 1:47 pm
Re: Two clients got the same IP
Hi Stephan,
thanks a lot for your support.
I've got the resolution:
For each client, I generated a unique certificate/key, but I always used the same CN. So, when the second client connected, the first client was dropped (*), because of identical CN OpenVPN thought, client 1 and 2 were one client.
(*):
MULTI: new connection by client 'oporto' will cause previous active sessions by this client to be dropped.
Kind regards,
Markus
thanks a lot for your support.
I've got the resolution:
For each client, I generated a unique certificate/key, but I always used the same CN. So, when the second client connected, the first client was dropped (*), because of identical CN OpenVPN thought, client 1 and 2 were one client.
(*):
MULTI: new connection by client 'oporto' will cause previous active sessions by this client to be dropped.
Kind regards,
Markus