Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenVPN DhcpPushRoutes Error, Related to "vpn_gateway" #1918

Open
neaese opened this issue Oct 15, 2023 · 6 comments
Open

OpenVPN DhcpPushRoutes Error, Related to "vpn_gateway" #1918

neaese opened this issue Oct 15, 2023 · 6 comments

Comments

@neaese
Copy link

neaese commented Oct 15, 2023

",route %r %r vpn_gateway",

The gateway ip address is not replaced with [vpn_gateway], causing the routing table to be incorrectly configured on the mobile phone client.
Error message :"route destinations other than vpn_gateway or net_gateway are not supported"

@parkycai
Copy link

parkycai commented Nov 10, 2023

	if (r->Exists)
 	{
 		Format(l3_options, sizeof(l3_options),
-			",route %r %r vpn_gateway",
-			&r->Network, &r->SubnetMask);
+			",route %r %r %r",
+			&r->Network, &r->SubnetMask, &r->Gateway);
 
 		StrCat(option_str, sizeof(option_str), l3_options);
 	}

@officialh1
Copy link

What version are you using? This code is commented out in the somewhat recent pull that I have...:

if	0	// Currently disabled
										// If the default gateway is not specified, add the static routing table
										// entry for the local IP subnet
										IP local_network;
										IP client_ip;
										IP subnet_mask;

										UINTToIP(&client_ip, cao->ClientAddress);
										UINTToIP(&subnet_mask, cao->SubnetMask);

										Zero(&local_network, sizeof(IP));
										IPAnd4(&local_network, &client_ip, &subnet_mask);

										Format(l3_options, sizeof(l3_options),
										       ",route %r %r vpn_gateway",
										       &local_network,
										       &cao->SubnetMask);

										StrCat(option_str, sizeof(option_str), l3_options);
#endif

@parkycai
Copy link

What version are you using? This code is commented out in the somewhat recent pull that I have...:

if	0	// Currently disabled
										// If the default gateway is not specified, add the static routing table
										// entry for the local IP subnet
										IP local_network;
										IP client_ip;
										IP subnet_mask;

										UINTToIP(&client_ip, cao->ClientAddress);
										UINTToIP(&subnet_mask, cao->SubnetMask);

										Zero(&local_network, sizeof(IP));
										IPAnd4(&local_network, &client_ip, &subnet_mask);

										Format(l3_options, sizeof(l3_options),
										       ",route %r %r vpn_gateway",
										       &local_network,
										       &cao->SubnetMask);

										StrCat(option_str, sizeof(option_str), l3_options);
#endif

I'm using [5.01.9674] which is used in OpenWRT. I noticed that the above code is to fix classless routing table push code, which is already fixed in 5.02.5180.

@chipitsine
Copy link
Member

yes, I need to fix release machinery and emit new release
hopefully will do that soon

@parkycai
Copy link

yes, I need to fix release machinery and emit new release hopefully will do that soon

great!

What version are you using? This code is commented out in the somewhat recent pull that I have...:

if	0	// Currently disabled
										// If the default gateway is not specified, add the static routing table
										// entry for the local IP subnet
										IP local_network;
										IP client_ip;
										IP subnet_mask;

										UINTToIP(&client_ip, cao->ClientAddress);
										UINTToIP(&subnet_mask, cao->SubnetMask);

										Zero(&local_network, sizeof(IP));
										IPAnd4(&local_network, &client_ip, &subnet_mask);

										Format(l3_options, sizeof(l3_options),
										       ",route %r %r vpn_gateway",
										       &local_network,
										       &cao->SubnetMask);

										StrCat(option_str, sizeof(option_str), l3_options);
#endif

I believe the code inside the 'else' block above should be disabled. In the absence of default gateway, you should use classless routing to specify routing information for certain network segments.

@chipitsine
Copy link
Member

@parkycai , I've just pushed new release https://github.com/SoftEtherVPN/SoftEtherVPN/releases/tag/5.02.5181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants