Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Ubuntu 11.10 on my dev laptop. And the company I work for requires a vpn connection if I am working remotely. Also they require me to use their proxy server.

It is possible to set the proxy settings automatically only when I am on vpn? I want to remove the proxy settings as soon as I disconnect from the vpn.

share|improve this question
    
Ask if they use an automatic proxy configuration script. If they do, this will only work when connected to the VPN and in the office, and will automatically stop proxying when you disconnect. –  Paul Feb 3 '12 at 13:26
    
They do.http://..../squidproxy.pac . I have to put this as system wide proxy setting on ubuntu. But as soon as disconnect from vpn, I can't open any web page. –  Optimus Feb 3 '12 at 13:35
add comment

1 Answer

up vote 1 down vote accepted

If you were to use Network Manager to establish the vpn, then you could use proxydriver, which is a plugin for Network Manager and will change the proxy settings you are using based on the network you connect to.

share|improve this answer
    
This seems like a good option but unfortunately it doesn't revert back the proxy settings when I disconnect from the vpn. –  Optimus Feb 3 '12 at 14:37
    
This is the log I have when I connect ` Feb 3 14:35:56 dylan proxydriver: interface 'ppp0' now up, will try to setup proxy configuration... Feb 3 14:35:56 dylan proxydriver: using configuration file '/etc/proxydriver.d/vpn_VPN_connection_1.conf' Feb 3 14:35:56 dylan proxydriver: setting configuration for 'bill' Feb 3 14:35:57 dylan proxydriver: configuration done. ` but there is nothing when I disconnect –  Optimus Feb 3 '12 at 14:37
    
Wow, I hacked my first bash script :) It's working !!! Thanks –  Optimus Feb 3 '12 at 15:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.