Howto route just the trafic for the other location

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
mannebk
OpenVpn Newbie
Posts: 2
Joined: Tue Feb 15, 2011 11:18 pm

Howto route just the trafic for the other location

Post by mannebk » Tue Feb 15, 2011 11:36 pm

Hi there,

i got a few questions. maybe some real dump one, sorry for it, im just a MS guy, not realy good on Linux.... :oops: but maybe if i need to work more mit linux it will get better...

So here is what i have for a goal:

i do have two locations, both running by them slefs, just one special printer in one location is to be used from the other location, and one special dataserver also to be used via vpn for filesharing.

location a

has the printer
has no dyn ip, but dyn dns resolution by dyndns.com
3mbit down 0,38mbit up
Local server is 192.168.1.1/24
Printer is 192.168.1.28
local dns and gateway to internet is 192.168.1.1
Server 192.168.1.1 has running OpenVPN

location b
has the nas
has permanet ip.
16mbit down, 1,5mbit up
local server is 192.168.2.1/24
data server is 192.168.2.22
local dns and gateway to internet is 192.168.2.1
Server 192.168.2.1 has running open vpn



how do i need do configure openvpn for just having the trafic für the other subnet going throu the vpn by same time still running a independend DHCP server for both locations. we do not want to have both locations in the same sub net, and we want to have dynamic ip adressing on both locations.

i dont want the people surf and mail through the vpn, that would be a midsize desater.

ah, and we sometimes use remote desktop clint over vpn and sometimes teamview as well

and, what i didnt understand from all howtos, whitch one is for me the server,


what els of information do you need?

Thanks a lot.

Manfred

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: Howto route just the trafic for the other location

Post by janjust » Wed Feb 16, 2011 3:00 pm

this sounds like you want a site-to-site setup, which is perfectly well possible. Read the OpenVPN HOWTO for details on how to set this up.

On site A, I'd do something like

Code: Select all

  openvpn --genkey secret.key
Transfer this key to site B.
Then run on site A:

Code: Select all

  openvpn --dev tun --proto udp --port 1194 --secret secret.key --ifconfig 10.200.0.1 10.200.0.2 --route 192.168.2.0 255.255.255.0
On site B:

Code: Select all

  openvpn --dev tun --proto udp --port 1194 --secret secret.key --ifconfig 10.200.0.2 10.200.0.1 --route 192.168.1.0 255.255.255.0 --remote <siteA IP>
After that you need to tell the network at site A that the network 192.168.2.0/24 can be found via 192.168.1.1
Vice versa, you need to tell the network at site B that the network 192.168.1.0/24 ca ben found via 192.168.2.1

HTH,

JJK

mannebk
OpenVpn Newbie
Posts: 2
Joined: Tue Feb 15, 2011 11:18 pm

Re: Howto route just the trafic for the other location

Post by mannebk » Thu Feb 17, 2011 3:22 pm

Hi JJK,

thx a lot. i ll try, and report.

cu

manfred

Post Reply