Automatically change Mac system-wide proxy settings after connecting and reverting back after disconnecting

138 views
Skip to first unread message

khalida...@gmail.com

unread,
Aug 4, 2015, 7:31:59 AM8/4/15
to tunnelblick-discuss
Hi

I know Tunnelblick can do that to DNS settings and such. But is there a way to change proxy settings once Tunnelblick connects and revert back to previous settings once it disconnects?

The scenario is as follows:

Under a very restrictive network, I managed to get tunnelblick to connect to my openVPN successfully, the restrictive network requires a proxy setting to work. So with tunnelblick I setup the configuration file to connect using an HTTP proxy which already works fine.

Problem is, when openVPN is connected, the internet is not reachable with a proxy setup in System preferences network, until I remove the proxy settings. Which is also fine and makes sense, but after disconnecting Tunnelblick I have to go back to the network settings and re-add the proxies. This can quickly become a long process.

So since Tunnelblick already does this to DNS settings, I was wondering if that can also work for proxy settings?

Thanks

jkbull...gmail.com

unread,
Aug 4, 2015, 7:53:21 AM8/4/15
to tunnelblick-discuss, khalida...@gmail.com
This doesn't make sense to me; perhaps I don't understand correctly.

As I understand it, you are setting up to use a proxy to connect to your OpenVPN server by setting the http-proxy and http-proxy-option directives in the OpenVPN configuration file.

You can connect OK, but after disconnecting, "the internet is not reachable with a proxy setup in System preferences network, until I remove the proxy settings".

I'm not sure what you mean by that. As far as I know, OpenVPN does not change the System preferences when you use the http-proxy and http-proxy-option directives. (OpenVPN changes the routing, but it restores the routing when the connection terminates.)

Tunnelblick changes the DNS settings (at OpenVPN's request), so Tunnelblick restores them. But Tunnelblick doesn't do anything with the proxy settings, so it shouldn't be responsible for restoring them.

If OpenVPN is somehow changing the System Configuration proxy settings, then OpenVPN should restore them. If it isn't restoring them, then perhaps there's a bug in OpenVPN, but it is more likely that your OpenVPN setup is misconfigured.

Please post the diagnostic info as described in Read Before You Post, that might help find the problem.

If the System Configuration proxy settings are being changed by OpenVPN and not restored because of a bug in OpenVPN, you can probably restore them in a Tunnelblick "post-disconnect.sh" script; see Using Scripts.
Reply all
Reply to author
Forward
0 new messages