VPN Routing advice

Need help configuring your VPN? Just post here and you'll get that help.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
B-Man
OpenVPN User
Posts: 25
Joined: Fri Jan 27, 2017 12:11 pm

VPN Routing advice

Post by B-Man » Thu Oct 18, 2018 8:41 am

I would like my devices to connect to the vpn so im able to access my home network while away.

Objective
-Local traffic to go through VPN 192.168.0.x (home LAN), 192.168.1.x (home VPN)
-All internet traffic to bypass the VPN
-VPN and LAN to connect to each other


Im running my OpenVPN server on my DD-WRT Router.

LAN is 192.168.0.x
VPN is 192.168.1.x

when i log in through VPN on a remote client i can ping
192.168.0.1 (router)
192.168.1.2 (phone connected to vpn)

but cant ping
192.168.0.7 (my pc)
or the internet. www.google.com, 8.8.8.8 etc.

My PC can ping
Router on 192.168.0.1
Pi vpn client on 192.168.1.3
Phone vpn client on 192.168.1.2


i have server Additional Config set as

Code: Select all

push "route 192.168.0.0 255.255.255.0"
and added

Code: Select all

push "route 192.168.1.0 255.255.255.0"
Server log file - https://pastebin.com/DCXrpggv

Client Conf

Code: Select all

client 
dev tun 
proto tcp 
remote my.ddns.net 1194 
nobind 
persist-key 
persist-tun 
verb 4 
float 
ca ca.crt 
cert Pi.crt 
key Pi.key 
comp-lzo yes 
tun-mtu 1500 
auth SHA256 
cipher AES-128-CBC
im unable to connect to the internet when connected to the VPN on my Pi

can someone help with my routing?
i have got this far and finally got the connections working correctly but been stuck on routing for months. i was having it fully connect to vpn and lose internet so i could do a few little things but now i need it fixed. as i need to keep it on 24/7

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 5015
Joined: Fri Jun 03, 2016 1:17 pm

Re: VPN Routing advice

Post by TinCanTech » Thu Oct 18, 2018 5:22 pm

B-Man wrote:
Thu Oct 18, 2018 8:41 am
Im running my OpenVPN server on my DD-WRT Router.

LAN is 192.168.0.x
VPN is 192.168.1.x
STEP-1: Never use common subnets for your LAN or VPN.

You will almost always get routing conflicts.

B-Man
OpenVPN User
Posts: 25
Joined: Fri Jan 27, 2017 12:11 pm

Re: VPN Routing advice

Post by B-Man » Fri Oct 19, 2018 5:21 am

ok i have changed my lan to 192.168.17.x
and vpn to 192.168.18.x

Still not working

B-Man
OpenVPN User
Posts: 25
Joined: Fri Jan 27, 2017 12:11 pm

Re: VPN Routing advice

Post by B-Man » Fri Oct 19, 2018 8:14 am

i removed

Code: Select all

push "route 192.168.17.0 255.255.255.0"
push "route 192.168.18.0 255.255.255.0"
and the vpn has internet and can ping vpn clients
the lan works fine but cant pong vpn.


i need to join the subnets together....?


Post Reply