Support for multiple Connection Blocks in a single config?

Got a problem with Viscosity or need help? Ask here!

xinmpg

Posts: 4
Joined: Thu Aug 14, 2014 1:46 am

Post by xinmpg » Thu Aug 14, 2014 1:52 am
Hello,

Sorry if this has been covered, but I couldn't find anything by searching. Admittedly the terms are vague so a ton of non-related results came up...

OpenVPN has support for "Connection Blocks" in client configuration where you can specify multiple OpenVPN server destinations sequentially in case they are down (or more likely, being filtered). For example, I could have:
Code: Select all
client
dev tun

<connection>
remote 198.19.34.56 443 udp
</connection>

<connection>
remote 198.19.34.56 443 tcp
</connection>

<connection>
remote 198.19.34.56 443 tcp
http proxy stuff for obfsproxy, etc...
</connection>

...

When I import this into Viscosity it unfortunately creates two connections, one for each of the above, with the same name causing confusion for the users.

My questions:
1) Is there any way to get Viscosity to support the <Connection> blocks above so that a user could select a single connection and it cycle through the available ones sequentially as intended?

2) If not, is there a way to have Viscosity create the different connections with unique names as to not cause confusion? Right now both connections will have the same name, from the file name. Is there some kind of OpenVPN config option I'm not aware of that could tag each <Connection> with unique names?

Thanks!

James

User avatar
Posts: 2313
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Sun Aug 17, 2014 6:44 pm
Hi xinmpg,

Viscosity doesn't support connection blocks (they'll be imported as separate connections), however it does support multiple remote servers in a single connection (including protocol and port number). For example, to specify multiple servers in Viscosity you can enter something like so into the Remote Server Address field: "vpn.example.com, vpn2.example.com:443:tcp vpn3.example.com:1195:udp".

Viscosity should be giving each connection block a unique name on import, however we'll look into why it isn't for you and include a fix in the next beta release if necessary.

Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs

xinmpg

Posts: 4
Joined: Thu Aug 14, 2014 1:46 am

Post by xinmpg » Tue Aug 19, 2014 2:08 am
Hi James,
however it does support multiple remote servers in a single connection (including protocol and port number). For example, to specify multiple servers in Viscosity you can enter something like so into the Remote Server Address field: "vpn.example.com, vpn2.example.com:443:tcp vpn3.example.com:1195:udp".
Is this something that works in a normal OpenVPN config also, Or is it specific to Viscosity?

Is there anything from me you need to troubleshoot the two connections having the same name?

James

User avatar
Posts: 2313
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Tue Aug 19, 2014 4:19 am
Hi xinmpg,
Is this something that works in a normal OpenVPN config also, Or is it specific to Viscosity?
OpenVPN supports specifying multiple remote statements in a configuration file as well.
Is there anything from me you need to troubleshoot the two connections having the same name?
Nothing needed: naming should be working correctly in the latest beta version (1.5b1 at the time of writing).

Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs

xinmpg

Posts: 4
Joined: Thu Aug 14, 2014 1:46 am

Post by xinmpg » Tue Aug 19, 2014 4:22 am
One last question James:
Remote Server Address field: "vpn.example.com, vpn2.example.com:443:tcp vpn3.example.com:1195:udp".
Could you point me to specific OpenVPN docs which could help me construct this in the proper format for a general OpenVPN config? I've only ever seen a single remote, or the connection blocks which I was using.

thanks

James

User avatar
Posts: 2313
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Wed Aug 20, 2014 1:26 am
Hi xinmpg,

You can refer to the "--remote" entry at:
https://community.openvpn.net/openvpn/w ... n23ManPage

Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
6 posts Page 1 of 1