I have recently managed to (finally) set up a VPN (Community edition) with the server residing on an old Windows 10 laptop (couldn't get a raspberry pi). I have two clients, also on Windows 10 laptops. One client is to access my home network from remote, insecure locations. This works fine with all internet traffic and home network traffic routed via the VPN. I can ping and tracert the traffic which shows the VPN is used.
The problem is with the second client which is designed to access a small number of sites via the VPN with everything else routed via usual gateway. By including the line
route domain.name 255.255.255.255
it works, with the logfile showing the route addition successful
Tue Jan 17 17:53:44 2023 C:\WINDOWS\system32\route.exe ADD domain.name MASK 255.255.255.255 10.**.**.1
Tue Jan 17 17:53:44 2023 Route addition via service succeeded
The problem comes when I try to add a second or subsequent route, it just fails to launch and I don't even get to the passphrase entry i/f.
I have searched the forum extensively (I think) and have found reference to this issue but none are identical and have found no solutions.
I wonder is it a limitation of Community edition OpenVPN? More likely, I am doing something stupid in the routing definition as I am new to this caper.
Anyone got any insights or ideally solutions?
Multiple Client routes
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 Expert
- Posts: 685
- Joined: Tue May 01, 2012 9:30 pm
Re: Multiple Client routes
you can add as many as you like and it should work ok
if you add this route into client so all client not go over vnp
route 0.0.0.0 192.0.0.0 net_gateway
route 64.0.0.0 192.0.0.0 net_gateway
route 128.0.0.0 192.0.0.0 net_gateway
route 192.0.0.0 192.0.0.0 net_gateway
if you like only let two website go over vpn just add this like
route www.vvv.xxx 255.255.255.255 vpn_gateway
route domain.name 255.255.255.255 vpn_gateway
if you add this route into client so all client not go over vnp
route 0.0.0.0 192.0.0.0 net_gateway
route 64.0.0.0 192.0.0.0 net_gateway
route 128.0.0.0 192.0.0.0 net_gateway
route 192.0.0.0 192.0.0.0 net_gateway
if you like only let two website go over vpn just add this like
route www.vvv.xxx 255.255.255.255 vpn_gateway
route domain.name 255.255.255.255 vpn_gateway
-
- OpenVpn Newbie
- Posts: 12
- Joined: Mon Dec 05, 2022 9:47 am
Re: Multiple Client routes
Yes, I know it should work, and according to any manuals I have seen, it should work. The man page says:
"Add route to routing table after connection is established. Multiple routes can be specified."
However, I can't get it to work no matter what format of route command I use. It just seems to have a limit of only one route.
"Add route to routing table after connection is established. Multiple routes can be specified."
However, I can't get it to work no matter what format of route command I use. It just seems to have a limit of only one route.
-
- OpenVPN Expert
- Posts: 685
- Joined: Tue May 01, 2012 9:30 pm
Re: Multiple Client routes
What openvpn client do you use? You didn't say anything about clients at all and claim that not work . No log. No config . No client version . That is simple nobody bore to answer your question .
There are many versions of openvpn client and each have different so just keep research yourself to make it work
There are many versions of openvpn client and each have different so just keep research yourself to make it work
-
- OpenVpn Newbie
- Posts: 12
- Joined: Mon Dec 05, 2022 9:47 am
Re: Multiple Client routes
Yes, that is what I have pencilled in to test next. I have the latest client version (3.3.6) and the latest server (2.6 beta). I intend to install latest stable version of server (2.5.8) and see if that works. Will post results when done.
-
- OpenVpn Newbie
- Posts: 12
- Joined: Mon Dec 05, 2022 9:47 am
Re: Multiple Client routes
Although, thinking about it, I can't see how the server version impacts on the operation of route commands in the client. I am not pushing routes from the server so presumably, it doesn't affect it. But what do I Know?
-
- OpenVpn Newbie
- Posts: 12
- Joined: Mon Dec 05, 2022 9:47 am
Re:Multiple Client routes
Solved.
I noticed something odd about the client config file but only when I viewed it in Word. There seemed to be no CR/LF between some lines even though it looked fine in Notepad and Notepad++. So I rearranged the file so that this anomaly was corrected and the client was then able to connect to the server even with multiple route commands included. However, the log file did not show any route additions and tracert showed the traffic was not routed as per the command. So solved one problem but created another one!
I then changed the line break character to Windows CRLF (in Notepad++, select Edit -> EOL Conversion -> Windows CR LF) in client.ovpn and hey presto, all worked ok, multiple routes were appearing as created in the log file and tracert showed all traffic routed correctly.
Woohooo.
I noticed something odd about the client config file but only when I viewed it in Word. There seemed to be no CR/LF between some lines even though it looked fine in Notepad and Notepad++. So I rearranged the file so that this anomaly was corrected and the client was then able to connect to the server even with multiple route commands included. However, the log file did not show any route additions and tracert showed the traffic was not routed as per the command. So solved one problem but created another one!
I then changed the line break character to Windows CRLF (in Notepad++, select Edit -> EOL Conversion -> Windows CR LF) in client.ovpn and hey presto, all worked ok, multiple routes were appearing as created in the log file and tracert showed all traffic routed correctly.
Woohooo.