Client connectivity 1 through VPN 1 not through vpn

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
llFawkes17ll
DD-WRT User


Joined: 24 Jul 2018
Posts: 158

PostPosted: Thu Aug 29, 2019 14:20    Post subject: Client connectivity 1 through VPN 1 not through vpn Reply with quote
Quick question regarding openvpn on Dd-WRT. I recently setup a system in my house where I have one router connected to a modem and the router is running Dd-wrt with openvpn with only specific ips going through the VPN. I have my nas connected to a separate router (in access point mode) which has a static ip outside the ip range which is going through the VPN. In addition I have a computer which is connected to the VPN and has a static ip. All are under the same subnet.
My question is, as I can still see my nas (not connected to the VPN) when under my network tab in Windows from my computer (which is connected to the VPN), is my computer's traffic still protected? I thought that since one client has an IP which is going through the VPN and the the other client is not going through the VPN then they shouldn't be able to talk to each other, right? Or am I wrong since they are under the same subnet?
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12887
Location: Netherlands

PostPosted: Thu Aug 29, 2019 15:25    Post subject: Reply with quote
You are wrong Wink

Traffic from your PC goes to the router and the router knows where the NAS is because it has a local route to its own subnet (and to the next hop)
(you must be using something else then the standard DDWRT PBR because the local routes are not present in the PBR routing table)

However if the VPN goes down you are no longer protected unless you implement a kill switch

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
llFawkes17ll
DD-WRT User


Joined: 24 Jul 2018
Posts: 158

PostPosted: Thu Aug 29, 2019 16:01    Post subject: Reply with quote
egc wrote:
You are wrong Wink

Traffic from your PC goes to the router and the router knows where the NAS is because it has a local route to its own subnet (and to the next hop)
(you must be using something else then the standard DDWRT PBR because the local routes are not present in the PBR routing table)

However if the VPN goes down you are no longer protected unless you implement a kill switch


You live and learn lol,right?

When you say that I must be using something else then the standard DDWRT PBR because the local routes are not present in the PBR routing table, what do you mean by it? I was able to get the PBR going via the instructions found here https://www.jeremybarr.ca/blog/2015/07/30/using-vpn-ip-range-ddwrt.

I do have a VPN kill switch via this command:
iptables -I FORWARD -s 192.168.1.64/26 -o $(nvram get wan_iface) -m state --state NEW -j REJECT

But in the end, am I protected based on how I currently have my network setup?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12887
Location: Netherlands

PostPosted: Sat Aug 31, 2019 15:47    Post subject: Reply with quote
llFawkes17ll wrote:
egc wrote:
You are wrong Wink

Traffic from your PC goes to the router and the router knows where the NAS is because it has a local route to its own subnet (and to the next hop)
(you must be using something else then the standard DDWRT PBR because the local routes are not present in the PBR routing table)

However if the VPN goes down you are no longer protected unless you implement a kill switch


You live and learn lol,right?

When you say that I must be using something else then the standard DDWRT PBR because the local routes are not present in the PBR routing table, what do you mean by it? I was able to get the PBR going via the instructions found here https://www.jeremybarr.ca/blog/2015/07/30/using-vpn-ip-range-ddwrt.

I do have a VPN kill switch via this command:
iptables -I FORWARD -s 192.168.1.64/26 -o $(nvram get wan_iface) -m state --state NEW -j REJECT

But in the end, am I protected based on how I currently have my network setup?


Kill switch is fine blocking the following IP range:
64 -127

You are using the standard PBR from DDWRT (probably entered 192.168.1.64/26 in the PBR field Smile

The alternate routing table usually does not have local routse so you might have trouble finding devices on the local network for clients in PBR range.

For an explanation see my signature at the bottom of this post: "simple PBR script" there are two solutions the easiest is to use the table-fix script from @eibgrad see: https://pastebin.com/YwnHLqaa

Or use my script for PBR Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
llFawkes17ll
DD-WRT User


Joined: 24 Jul 2018
Posts: 158

PostPosted: Sat Aug 31, 2019 16:34    Post subject: Reply with quote
egc wrote:
llFawkes17ll wrote:
egc wrote:
You are wrong Wink

Traffic from your PC goes to the router and the router knows where the NAS is because it has a local route to its own subnet (and to the next hop)
(you must be using something else then the standard DDWRT PBR because the local routes are not present in the PBR routing table)

However if the VPN goes down you are no longer protected unless you implement a kill switch


You live and learn lol,right?

When you say that I must be using something else then the standard DDWRT PBR because the local routes are not present in the PBR routing table, what do you mean by it? I was able to get the PBR going via the instructions found here https://www.jeremybarr.ca/blog/2015/07/30/using-vpn-ip-range-ddwrt.

I do have a VPN kill switch via this command:
iptables -I FORWARD -s 192.168.1.64/26 -o $(nvram get wan_iface) -m state --state NEW -j REJECT

But in the end, am I protected based on how I currently have my network setup?


Kill switch is fine blocking the following IP range:
64 -127

You are using the standard PBR from DDWRT (probably entered 192.168.1.64/26 in the PBR field Smile

The alternate routing table usually does not have local routse so you might have trouble finding devices on the local network for clients in PBR range.

For an explanation see my signature at the bottom of this post: "simple PBR script" there are two solutions the easiest is to use the table-fix script from @eibgrad see: https://pastebin.com/YwnHLqaa

Or use my script for PBR Smile


Is my computer which is in the PBR, but still (somehow lol) has access to my nas which is outside the PBR, protected when the VPN is on?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12887
Location: Netherlands

PostPosted: Sat Aug 31, 2019 16:57    Post subject: Reply with quote
If your ip address is in range with the kill switch then yes
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
llFawkes17ll
DD-WRT User


Joined: 24 Jul 2018
Posts: 158

PostPosted: Sat Aug 31, 2019 19:40    Post subject: Reply with quote
egc wrote:
If your ip address is in range with the kill switch then yes


That's great to hear. Now I hope that this computer doesn't forget to find the nas Laughing because I got used to it this way
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sun Sep 01, 2019 9:38    Post subject: Reply with quote
The client and the NAS will talk directly to each other through the switch as they are on the same sub-net. No routing will take place.

It's only when the destination is outside of the sub-net, that the client will contact the router to have the packet routed.
llFawkes17ll
DD-WRT User


Joined: 24 Jul 2018
Posts: 158

PostPosted: Sun Sep 01, 2019 10:09    Post subject: Reply with quote
Per Yngve Berg wrote:
The client and the NAS will talk directly to each other through the switch as they are on the same sub-net. No routing will take place.

It's only when the destination is outside of the sub-net, that the client will contact the router to have the packet routed.


Ohhhhh now that makes sense. Like I said before thank you so much for all your help. You are the man.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum