LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-15-2018, 12:47 AM   #1
av2zeal
Member
 
Registered: Jul 2008
Distribution: Slackware64
Posts: 56

Rep: Reputation: 1
Network VPN except 1 client


I'll try to keep this as simple as possible...

I recently subscribed to a vpn service provider and I configured my router (dd-wrt) to connect (openvpn client) and everything is working great. However, I would like to be able to access a server on my network to get to my files when I am away, but this service does not allow port forwarding as any number of users could be connected to a node at any given time. Is there a way to have the vpn as the default connection method for any given client, but specify one computer on my network to NOT use vpn? I've been searching on the internet and think that iptables for the router may be the answer?
 
Old 06-18-2018, 04:41 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,823

Rep: Reputation: 157Reputation: 157
The iptables can help this.
 
Old 06-26-2018, 02:51 AM   #3
av2zeal
Member
 
Registered: Jul 2008
Distribution: Slackware64
Posts: 56

Original Poster
Rep: Reputation: 1
After a bunch of digging, and trying to learn iptables, this is what I came up with:

echo 200 novpn >> /etc/iproute2/rt_tables
echo 201 yesvpn >> /etc/iproute2/rt_tables
ip rule add from <ip_i_don't_want_to_use_vpn> dev wan0 table novpn
ip rule add from default dev tun1 table yesvpn
ip route add <ip_i_don't_want_to_use_vpn> via <isp_gateway> dev wan0 table novpn
ip route add default via <vpn_server> dev tun1 table yesvpn

...but it doesn't seem to work, <ip_i_don't_want_to_use_vpn> is still behind the vpn and I cannot access it remotely. vpn provider does not offer port forwarding, nor do i want to go that route. Any help is much appreciated. Thank you!
 
Old 06-28-2018, 08:49 PM   #4
av2zeal
Member
 
Registered: Jul 2008
Distribution: Slackware64
Posts: 56

Original Poster
Rep: Reputation: 1
I was able to go into Services -> VPN and under the VPN Client settings, there is a box called "Policy Based Routing" I added 192.168.1.201/32 and it seems to work for my main system.
However, if i remove this line and I try to add blocks of addresses (to protect a range of ips on my network), i.e.:

192.168.1.200/30
192.168.1.205/27
192.168.1.237/28
192.168.1.253/31

it places 192.168.1.204 behind the vpn (which is the one I want to leave exposed).
Am I misunderstanding CIDR? I even had this corrupt the settings on my router and I had to do a 30/30/30 reset to clear my settings.
Any help is much appreciated.
 
Old 07-05-2018, 03:45 PM   #5
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,823

Rep: Reputation: 157Reputation: 157
Describe network topology. Where is 192.168.1.200/30? Is it IPSec inside network or IPSec network?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Share VPN-Client in Network Volvofan63 Linux - Networking 4 02-19-2018 09:44 AM
[SOLVED] VPN Client can't get to IPSec connected network zhjim Linux - Networking 1 06-06-2012 02:24 AM
client cannot access VPN network evo_trust Linux - Networking 1 06-17-2010 10:56 AM
VPN client to connect to my school's network lowpro2k3 Linux - Networking 2 09-01-2005 10:10 PM
Client connecting to network via VPN mbourne Linux - Security 1 10-13-2004 10:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration