What is "IP address that is compatible to tun device of the OpenVPN"???

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
donaldii
Posts: 9
Joined: Tue Sep 11, 2018 5:46 pm

Re: Problem: no DHCP IP obtained from server

Post by donaldii » Sat Sep 22, 2018 4:22 pm

Hi guys,

I am very new to DCHP and NAT stuff so please forgive me for my ignorance.

I am facing the same problem with supporting larger user groups on one server.

I think I am running out of ips for my users. However, I don't know how to configure the DHCP or NAT correcctly to provide them more ips.

Attached is my current config but it seems only a small portion of the IPs can be used.

Any input will be much appreciated.

Don

P.S. Some thread says Virtual NAT and local bridge doesn't work together, so I have deleted local bridge.
DHCP.PNG
You do not have the required permissions to view the files attached to this post.

donaldii
Posts: 9
Joined: Tue Sep 11, 2018 5:46 pm

What is "IP address that is compatible to tun device of the OpenVPN"???

Post by donaldii » Sun Sep 23, 2018 12:20 am

Hi Guys,

Sorry to flood this forum with questions. However, I do believe this deserves some discussion as well as knowledge sharing.

While reading the source code related to virtual DHCP IP allocation for openVPN clients, I found below code and comments. Through google I can't find any discussion on this tun device compatible IP address.

Can anyone shed some light on the subject, please?

Regards,

Code: Select all

// Identify whether the IP address is compatible to the tun device of OpenVPN
bool OvsIsCompatibleL3IP(UINT ip)
{
	IP p;

	UINTToIP(&p, ip);
	if ((p.addr[3] % 4) == 1)
	{
		return true;
	}

	return false;
}

// Get an IP address that is compatible to tun device of the OpenVPN after the specified IP address
UINT OvsGetCompatibleL3IPNext(UINT ip)
{
	ip = Endian32(ip);

	while (true)
	{
		if (OvsIsCompatibleL3IP(Endian32(ip)))
		{
			return Endian32(ip);
		}

		ip++;
	}
}


thisjun
Posts: 2458
Joined: Mon Feb 24, 2014 11:03 am

Re: Problem: no DHCP IP obtained from server

Post by thisjun » Wed Oct 17, 2018 7:04 am

The IP address of SecureNAT is included in the range of distributes.

Do you want to ask why distributed IP addresses are the only odd number?
OpenVPN protocol translator uses consecutive two IP addresses.
So, the client can only use the half number of the distributed IP addresses.

Post Reply