openvpn server connect to another server

This forum is for admins who are looking to build or expand their OpenVPN setup.

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.
raisedtozero
OpenVpn Newbie
Posts: 11
Joined: Tue May 17, 2011 1:20 pm

openvpn server connect to another server

Post by raisedtozero » Tue May 17, 2011 1:25 pm

i have 2 openvpn servers, lets name openvpn server A and openvpn server B


how can i do this setup??


clinet ---> openvpn Server A ----> openvpn Server B


so openvpn server A will act like a server to client and at the same time will act as client to server B


pls help.. how can i do this?

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

Re: openvpn server connect to another server

Post by janjust » Tue May 17, 2011 1:30 pm

* read the HOWTO
http://openvpn.net/index.php/open-sourc ... howto.html
* set up an openvpn server on B, then a client on A; make sure the connection between A and B is working
* set up an openvpn server on A, then make your pc a client to A

raisedtozero
OpenVpn Newbie
Posts: 11
Joined: Tue May 17, 2011 1:20 pm

Re: openvpn server connect to another server

Post by raisedtozero » Tue May 17, 2011 2:59 pm

hello...

ok so heres the setup

client - server a - > server b


when i connect my server a to server b

heres the error


Tue May 17 18:54:27 2011 TCP connection established with 178.xxx:80
Tue May 17 18:54:27 2011 TCPv4_CLIENT link local: [undef]
Tue May 17 18:54:27 2011 TCPv4_CLIENT link remote: 178.xxxx:80
Tue May 17 18:54:28 2011 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Tue May 17 18:54:31 2011 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 2028', remote='link-mtu 1528'
Tue May 17 18:54:31 2011 WARNING: 'tun-mtu' is used inconsistently, local='tun-mtu 2000', remote='tun-mtu 1500'
Tue May 17 18:54:31 2011 [server] Peer Connection Initiated with 178.33.86.196:80
Tue May 17 18:54:33 2011 TUN/TAP device tun0 opened
Tue May 17 18:54:33 2011 /sbin/ip link set dev tun0 up mtu 2000
Tue May 17 18:54:33 2011 /sbin/ip addr add dev tun0 local 10.8.0.6 peer 10.8.0.5
Tue May 17 18:54:33 2011 NOTE: unable to redirect default gateway -- Cannot read current default gateway from system
Tue May 17 18:54:33 2011 Initialization Sequence Completed



but when i connect client to server b.. its working fine.

pls help janjust, and other fellas

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

Re: openvpn server connect to another server

Post by janjust » Tue May 17, 2011 3:02 pm

Tue May 17 18:54:31 2011 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 2028', remote='link-mtu 1528'
Tue May 17 18:54:31 2011 WARNING: 'tun-mtu' is used inconsistently, local='tun-mtu 2000', remote='tun-mtu 1500'
don't specify 'tun-mtu 2000' in the config file for serverA.

Tue May 17 18:54:33 2011 NOTE: unable to redirect default gateway -- Cannot read current default gateway from system
how is serverA connected ? what is the default GW? a 3G modem? try specifying the default GW on the serverA side LAN using

Code: Select all

route-gateway <IP>

raisedtozero
OpenVpn Newbie
Posts: 11
Joined: Tue May 17, 2011 1:20 pm

Re: openvpn server connect to another server

Post by raisedtozero » Wed May 18, 2011 12:03 am

actually, server a and server b are linux VPS..

server a is in USA, while server B is in France


their default gateway is the NIC card? how can i solved this problem

xsurfer
OpenVPN User
Posts: 21
Joined: Tue May 17, 2011 7:44 am

Re: openvpn server connect to another server

Post by xsurfer » Wed May 18, 2011 5:08 am

raizedtozero: Why do you want to need such setup ( client ---> openvpn Server A ----> openvpn Server B ) ?

What is your purpose?

raisedtozero
OpenVpn Newbie
Posts: 11
Joined: Tue May 17, 2011 1:20 pm

Re: openvpn server connect to another server

Post by raisedtozero » Wed May 18, 2011 5:55 am

kawawang xsurfer :)

xsurfer
OpenVPN User
Posts: 21
Joined: Tue May 17, 2011 7:44 am

Re: openvpn server connect to another server

Post by xsurfer » Wed May 18, 2011 6:29 am

uu nga bro. just asking why you need it.

raisedtozero
OpenVpn Newbie
Posts: 11
Joined: Tue May 17, 2011 1:20 pm

Re: openvpn server connect to another server

Post by raisedtozero » Wed May 18, 2011 12:01 pm

@janjust, how can i do it?


client -> server a -> server b


server a and server b are just linux VPS


how can i add gateway, like proper steps.. thank you very much

pls help

xsurfer
OpenVPN User
Posts: 21
Joined: Tue May 17, 2011 7:44 am

Re: openvpn server connect to another server

Post by xsurfer » Wed May 18, 2011 1:31 pm

wow raised, you're telling na its me na kawawa that I am asking questions, where you are also here asking questions yourself.

Can I say that you are also kawawa since you are asking pitifully? Dont say such things because you are just looking at a mirror and telling kawawa to yourself.

Let us just be respectful to one another here.

If you cannot say something nice, dont say something not nice even if others cannot understand your dialect.

You are acting like you are really knowledgeable. I know you. I know what forum you come from. I come from that forum too.

We all ask questions and need answers. Just be respectful buddy. I guess I have never talked to you in any manner that is disrespectful to you.

Oh! are you hurt by my question "What is your purpose?"

How can we understand what you are doing? So by understanding what you are doing will give the helper information on how to help you.

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

Re: openvpn server connect to another server

Post by janjust » Wed May 18, 2011 2:40 pm

raisedtozero: I already pointed out a few steps that you need to take (change mtu settings) ; what happens if you change the MTU setting and then try to get server A to talk to server B?


PS: please don't send me private messages (PMs); the likelihood of me helping decreases with each PM.

xsurfer
OpenVPN User
Posts: 21
Joined: Tue May 17, 2011 7:44 am

Re: openvpn server connect to another server

Post by xsurfer » Thu May 19, 2011 4:43 am

I wonder if you use the same server B and server A have the same server option !

raisedtozero
OpenVpn Newbie
Posts: 11
Joined: Tue May 17, 2011 1:20 pm

Re: openvpn server connect to another server

Post by raisedtozero » Thu May 19, 2011 11:04 am

i still get this error,

Tue May 18 23:34:14 2011 NOTE: unable to redirect default gateway -- Cannot read current default gateway from system

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

Re: openvpn server connect to another server

Post by janjust » Thu May 19, 2011 11:15 am

figure out what the default GW is on serverA (check '/sbin/ip route') then add

Code: Select all

route-gateway <GW-IP>
to the client config file on server A.

raisedtozero
OpenVpn Newbie
Posts: 11
Joined: Tue May 17, 2011 1:20 pm

Re: openvpn server connect to another server

Post by raisedtozero » Thu May 19, 2011 11:31 am

hello,

this is the reply from Server a


169.254.0.0/16 dev venet0 scope link
default dev venet0 scope link

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

Re: openvpn server connect to another server

Post by janjust » Thu May 19, 2011 11:40 am

this server seems screwed up ; do a

Code: Select all

traceroute -n 8.8.8.8
and check the first entry

raisedtozero
OpenVpn Newbie
Posts: 11
Joined: Tue May 17, 2011 1:20 pm

Re: openvpn server connect to another server

Post by raisedtozero » Thu May 19, 2011 12:07 pm

traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 40 byte packets
1 64.31.59.7 0.040 ms 0.020 ms 0.016 ms
2 208.115.192.49 152.492 ms * *
3 208.115.192.2 0.548 ms 64.125.188.181 0.505 ms 0.486 ms
4 64.125.188.181 0.632 ms 0.608 ms 0.586 ms
5 64.125.27.210 0.984 ms 64.125.26.210 0.867 ms 0.855 ms
6 64.125.12.186 1.560 ms 64.125.26.210 0.826 ms 64.125.12.186 1.516 ms
7 72.14.233.65 0.881 ms 72.14.233.67 0.887 ms 64.125.12.186 1.274 ms
8 72.14.238.243 24.467 ms 24.389 ms 72.14.233.65 1.137 ms
9 72.14.232.213 24.315 ms 72.14.233.87 35.708 ms 72.14.238.243 23.564 ms
10 72.14.232.213 23.548 ms 23.522 ms 209.85.253.133 32.475 ms
11 209.85.253.145 27.015 ms 209.85.253.133 31.980 ms 8.8.8.8 22.952 ms

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

Re: openvpn server connect to another server

Post by janjust » Thu May 19, 2011 12:09 pm

so try using

Code: Select all

route-gateway 64.31.59.7 

raisedtozero
OpenVpn Newbie
Posts: 11
Joined: Tue May 17, 2011 1:20 pm

Re: openvpn server connect to another server

Post by raisedtozero » Thu May 19, 2011 12:14 pm

where will i put route-gateway?


in server a client config? server config? server a or server b. tnx

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

Re: openvpn server connect to another server

Post by janjust » Thu May 19, 2011 12:26 pm

some thinking on your part is required...

put this in the configuration file of the host that is throwing the 'cannot determine default gateway' message.

Post Reply