What's new

Same IP for all clients over TUN

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

alini76

Occasional Visitor
I have Merlin 386.4 on my RT-AC68U router. I configured TUN OpenVPN, but all my VPN clients are getting same IP 10.8.0.2. Because of this, obviously, the clients are getting disconnected each other.
 

Attachments

  • TUNOpenVPN.png
    TUNOpenVPN.png
    111.4 KB · Views: 85
It looks like if I change "Manage Client-Specific Options" to NO, then the IP is assigned differently.
 
Because of this, obviously, the clients are getting disconnected each other.
This shouldn't be the cause of any disconnection. 10.8.0.2 is the first IP address in the pool which is assigned to the first client. If that client disconnects the IP address is freed up and it will be reassigned to the next client that connects. The only time you'll see IP addresses 10.8.0.3, 10.8.0.4, etc. is when you have multiple clients connected at the same time.
 
It is about having multiple clients. My concern is that I have 2 clients connected and both are taking the same IP. Obviously that I do not care if a client takes the IP of a client that disconnected at his own will.
 
It is about having multiple clients. My concern is that I have 2 clients connected and both are taking the same IP.
I can't image how that is possible. Look at the router's syslog when the second client connects to see why it is assigning the invalid address.

You said in your previous posts that you couldn't create VPN user accounts. Is that still a problem? Maybe it's connected to this problem.
 
I do not see a reason in syslog why this happens.
With the latest merlin firmware, the problem with managing users and their password is gone.
 
As well, please notice that the problem of IP assignment is resolved if I set "Manage Client-Specific Options" to NO. [but I need this to be YES, so is not a permanent solution]
 
As well, please notice that the problem of IP assignment is resolved if I set "Manage Client-Specific Options" to NO. [but I need this to be YES, so is not a permanent solution]
What customisation are you doing to the default setup?
 
I have Merlin 386.4 on my RT-AC68U router. I configured TUN OpenVPN, but all my VPN clients are getting same IP 10.8.0.2. Because of this, obviously, the clients are getting disconnected each other.
if you have multiple clients with same client keys it's disconnect when other connecting.
You have to set "--duplicate-cn" If you don't want clients disconnecting.
Or you can create invidual certs for all vpnclients
 
Last edited:
I did not setup duplicate-cn in older versions of the Merin firmware. I kind of agree that the duplicate CN is the issue, even I am using it for many years, without setting up anything. but I will try this.
 
Look at the router's syslog when the second client connects to see why it is assigning the invalid address.
I do not see a reason in syslog why this happens.
It's strange you don't get this rather obvious message in your syslog:
Code:
Feb 19 16:30:07 ovpn-server1[25148]: MULTI: new connection by client 'client' will cause previous active sessions by this client to be dropped.  Remember to use the --duplicate-cn option if you want multiple clients using the same certificate or username to concurrently connect.
 
Most likely it's because when you configured Manage Client-Specific Options, you probably specified the CN (Common Name) of the cert (typically 'client' if using the auto-generated files), which is then the only means to distinguish one client from another. But since ALL your OpenVPN clients are using the same client cert, it throws off the current user in favor of the next to resolve the ambiguity.

I would try adding the following directive to the custom config field and then specifying the username rather than the common name of the cert in Manage Client-Specific Options.

Code:
username-as-common-name

Of course, each concurrent OpenVPN client should then use a different username.

This isn't normally a problem when each client is provided w/ its own client cert (and unique CN) and keys. But since most users don't both to do this (they probably should imo), but instead rely on *one* shared client cert, this becomes necessary.
 
I did not setup duplicate-cn in older versions of the Merin firmware.
That was changed a few release ago, to follow the recommendation of the OpenVPN developers. When using "Manage Client Options", you are expected to create a separate configuration for each client, including a unique certificate. That option enables the use-client-dir option.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top