openvpn on a multi wan machine (2 ISPs)

How to customize and extend your OpenVPN installation.

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

Post Reply
rickstinson
OpenVpn Newbie
Posts: 3
Joined: Sat Feb 07, 2015 6:58 pm

openvpn on a multi wan machine (2 ISPs)

Post by rickstinson » Sat Feb 07, 2015 7:11 pm

Hello everybody,

on my ovpn machine i have connected two different ISPs with two different IPs and two gateways.
it should be possible to get connected externaly with both ip adresses to openvpn (some kind of failover)

so far the setup is working with isp1 like a charme.
but i cant connected from eg my home to the second IP, TLS handshake problems...
"TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)"

it seems to be (as far i see in netcat) openvpn receive data from the second IP but sends always from the IP of the first ISP.

this is my setup:
ETH0 10.10.10.1 / gateway 10.10.10.254 #isp1
ETH1 20.20.20.1 / gateway 20.20.20.254 #isp2

eth0 / 10.10.10.254 is the default gateway
for eth1 i set up routing:

ip route add 20.20.20.0/24 dev eth1 src 20.20.20.254 table UPC
ip route add default via 20.20.20.254 dev eth1 table UPC
ip rule add from 20.20.20.0/24 table UPC
ip rule add to 20.20.20.0/24 table UPC

the server is reachable with both ips (tested with http/apache and ssh).
and also the outgoing traffic seems to be right -- tested it with:

curl --interface 20.20.20.1 text.whatisyourip.org
-> returns 20.20.20.1

where's my mistake? ;-)
thx,
patrick

rickstinson
OpenVpn Newbie
Posts: 3
Joined: Sat Feb 07, 2015 6:58 pm

Re: openvpn on a multi wan machine (2 ISPs)

Post by rickstinson » Mon Feb 09, 2015 9:47 am

it seems to be a problem with UDP... when i change the server/client settings to use TCP instead of UDP everything works fine (i cant connect to both external IPs).

is this normal? (openvpn 2.2.1 / ubuntu 12.04 x64)

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: openvpn on a multi wan machine (2 ISPs)

Post by maikcat » Mon Feb 09, 2015 10:43 am

udp is connectionless,

in openvpn you can specify float directive and see if that helps.

also take a look at this please

http://tldp.org/HOWTO/Adv-Routing-HOWTO ... links.html

Michael.

rickstinson
OpenVpn Newbie
Posts: 3
Joined: Sat Feb 07, 2015 6:58 pm

Re: openvpn on a multi wan machine (2 ISPs)

Post by rickstinson » Mon Feb 09, 2015 1:52 pm

thanks a lot, that makes sense! :-)

Ptite-Pomme
OpenVpn Newbie
Posts: 14
Joined: Thu Feb 19, 2015 3:52 pm

Re: openvpn on a multi wan machine (2 ISPs)

Post by Ptite-Pomme » Mon Mar 09, 2015 8:11 am

Hi mate!

I don't know if you manage to make it, but in my case, it worked, using UDP, through two different ISP, with two routers, that belong to our ISPs.

Regards,

Quentin. :)

Post Reply