LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 02-15-2007, 12:24 PM   #1
fpiergen
LQ Newbie
 
Registered: Nov 2005
Posts: 12

Rep: Reputation: 0
Access to LAN via VPN


I have established a VPN connection from a home computer to a linux box (VPN server) at work. I have a connection to the linux box but not the LAN the box is connected to. How do I set up routing so that I can access the LAN at work from my computer at home via the VPN?

Here are the specifics:

Home:
Quote:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
129.44.180.126 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.16.24.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

VPN connection is via ppp0 (192.168.2.1)
Work:
Quote:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.2 * 255.255.255.255 UH 0 0 0 ppp0
172.16.24.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 172-16-24-1.bos 0.0.0.0 UG 0 0 0 eth0

ppp0 is the other side of the tunnel
I can access the VPN server box but none of the 172.16.24.0 subnet. Does anyone know the specifics on on how to be able to access the 172.16.24.0 network from my home computer through this tunnel?

Thanks
 
Old 02-15-2007, 02:36 PM   #2
karpi
Member
 
Registered: Oct 2005
Location: Germany
Distribution: Suse
Posts: 134

Rep: Reputation: 15
Hello,

the details of how to do it depends on your distri.
But you should follow the following procedure:

1st: first you have to setup the vpn-server as router.
So it is able to send packages from 172.16.24.0 to 192.168.2.0

2nd: On all PCs you want to connect to you have to establish the following routes
Command (as root or via sudo)

route add -net 172.16.24.0 netmask 255.255.255.0 gw {vpn-server-address}

This is necessary when the vpn-server isn't the default gateway.
Because if there is no specific route the other servers will use the default-gateway.
(Without the routes they will receive your ping, but will send the pong to the wron street :-) )

In most distributions you will find some gui to configure the necassary elements (router, routes) on the servers .



HTH
 
Old 02-15-2007, 03:37 PM   #3
fpiergen
LQ Newbie
 
Registered: Nov 2005
Posts: 12

Original Poster
Rep: Reputation: 0
First of all thanks very much for your reply karpi. I do have a question

when you wrote "set up vpn-server as router" do you mean the machine the vpn is running on or the pptp process running on the machine?

Thanks
 
Old 02-15-2007, 04:14 PM   #4
karpi
Member
 
Registered: Oct 2005
Location: Germany
Distribution: Suse
Posts: 134

Rep: Reputation: 15
Hi,

it should be the machine running the machine runnung the vpn.
On most distros it is a simple click somewhere in the network-configuration.
Most distros disable routing by default, because it is more secure.

I forgot to mention, you should establish the routes on the machines you want to connect to via script,
to have it started at every reboot.

HTH
 
  


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
How to access VPN + LAN in iptables Firewall pradeepjagtap Linux - Security 4 10-24-2006 01:08 AM
vpn error through LAN Golzari-Ali Linux - Networking 1 09-10-2006 02:37 PM
No Internet but LAN and VPN connect LAN work fine??? xavior Suse/Novell 7 11-09-2005 02:14 PM
VPN Lan to Lan OpsVentus Linux - Networking 0 03-09-2004 03:05 PM
linux VPN & LAN shojav Linux - Networking 2 02-13-2003 11:21 PM


All times are GMT -5. The time now is 09:08 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration