LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-12-2017, 03:17 PM   #1
lxlx714
LQ Newbie
 
Registered: Nov 2017
Posts: 6

Rep: Reputation: Disabled
how to bridge network via VPN


Hi folks, I would like to ask some advice on how to configure my network. I am using an ISP(Webpass) does not provide public ipv4, hence, my home VPN server is not accessible from many networks(which does not support ipv6).

What I did is using a linux server on Google Cloud as VPN server, and I initiate a VPN connection from my home server to this remote cloud VPN server.

Now if I connect to this VPN server from my laptop, I can SSH and connect to "this particular" home server, which joined the VPN network. For the rest of devices, there is no route to the host, although I tried to add a static route.

My question: is server a way I could use this VPN to establish a channel, so that all my computers in home network can be accessed from the laptop joined the VPN server?

Thank you very much

My topology:
Laptop. ------------ Remote VPN server ---------Home Server -------Home Network VPN
192.168.1.100 ------<-ppp0-------ppp1->--------192.168.1.101--------10.5.1.1/24
--------------------------------------------------10.5.1.2 in home network
 
Old 11-14-2017, 02:08 PM   #2
lxlx714
LQ Newbie
 
Registered: Nov 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
anyone has any idea or suggestion? maybe I didn't explain clear enough?
 
Old 11-14-2017, 04:58 PM   #3
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 2,364

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
I'm not clear about what your trying to do beyond the fact that you have a laptop and server connected to a common remote VPN server. Are you also trying to share the VPN connection via your laptop? Why don't you set up a router to initiate the VPN connection and put the hosts behind that router? Some more clarification probably necessary here.
 
Old 11-15-2017, 03:22 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,526

Rep: Reputation: 137Reputation: 137
What protocol do you use for VPN, IPSec?
 
Old 11-15-2017, 05:04 PM   #5
lxlx714
LQ Newbie
 
Registered: Nov 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ferrari View Post
I'm not clear about what your trying to do beyond the fact that you have a laptop and server connected to a common remote VPN server. Are you also trying to share the VPN connection via your laptop? Why don't you set up a router to initiate the VPN connection and put the hosts behind that router? Some more clarification probably necessary here.
I am using xl2tp over IPSec.

End goal trying to access my home network(all machines) via a VPN server sitting on AWS. My problem with ISP is I am not assigned with a public accessible IPv4, so I cannot VPN back to my "router" or "VPN server hosted behind router" directly. I am thinking if it is feasible to VPN into this AWS hosted server, from laptop(say at work), and from a server at home. Then I would have a ppp0 and ppp1 interface on the VPN server. Maybe I could add some "bridge" or "static route", so that I could bring my home network accessible?

hope above explanation is clear
 
Old 11-15-2017, 05:54 PM   #6
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 2,364

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Set up packet forwarding on the cloud-based VPN server, then you should be able to route traffic between the two networks.

https://tecadmin.net/enable-ip-forwarding-linux/
 
Old 11-15-2017, 06:12 PM   #7
lxlx714
LQ Newbie
 
Registered: Nov 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ferrari View Post
Set up packet forwarding on the cloud-based VPN server, then you should be able to route traffic between the two networks.

https://tecadmin.net/enable-ip-forwarding-linux/
Thanks!! I think I already have this setting on the VPN server. However, when I try to access a desktop in my home network other than server(which login the VPN server), I got no route to host error.
Laptop : assigned 192.168.1.2 by VPN server
Home server: assigned 192.168.1.3 by VPN server, 10.5.1.2 on home network
Home desktop: 10.5.1.3

I could ssh into the home server from laptop with 192.168.1.3 IP, but not able to ping or SSH 10.5.1.3. I added a static route of network 10.5.1.0/24 via ppp1 interface, but seems it is not helping. Do I need to add anything to the home server network configuration?
 
Old 11-15-2017, 06:53 PM   #8
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 2,364

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
So your home server is acting as a router. Does that have IP forwarding enabled?
 
Old 11-16-2017, 03:29 PM   #9
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,526

Rep: Reputation: 137Reputation: 137
Does VPN server tell Laptop how to route 10.5.1.1/24 network's traffic? You might need add a static route on Laptop to indicate how to route 10.5.1.1/24 traffic.
 
Old 11-19-2017, 12:36 AM   #10
lxlx714
LQ Newbie
 
Registered: Nov 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
after adding 10.5.1.0/24 as static route on vpn server, i could use server's ip(local to home) 10.5.1.2 to connect. However, other IPs (10.5.1.3) is not accessible.
Many said it is b/c p2p tunnel does not understand network(only point ip), so feels like i need to make a tunnel on top of the p2p tunnel.
 
Old 11-21-2017, 03:32 PM   #11
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,526

Rep: Reputation: 137Reputation: 137
If possible, it is better to move 192.168.1.100 p2p between Home Server and Home Network VPN.
 
  


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
Bridge VPN to Ethernet (tun0 to eth1) Unknown_User Linux - Software 1 02-22-2015 03:39 PM
network bridge with proxy or vpn? andyvk Linux - Networking 2 12-01-2014 10:36 AM
vpn-vpn Bridge between two networks (1x Debian Server, 1x Cisco RVS4000) qawse Linux - Networking 2 01-14-2011 02:16 AM
VPN Server on Bridge [FC7] aacable Linux - Server 0 07-28-2008 04:03 AM
Bridge simulating Network Lag, for developing network code for games intripoon Linux - Networking 18 10-27-2005 06:04 PM

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

All times are GMT -5. The time now is 09:09 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration