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'm using my laptop in different offices, and whenever I switch locations I have to re-set the http proxy for wget, firefox, apt, etc...

Is there a way to do this automatically based on the local IP address I get? Fortunately these are from different subnets, so rules could be set up like that.

Another possibility would be to set up a local proxy on my laptop, and set it as the proxy. Then again the question is, how to have this proxy reconfigured automatically based on the IP address.

share|improve this question

2 Answers 2

This seems to be something that NetworkManager should do; but based on some searching it doesn't seem to. The most robust solution that I've come across so far is completely managing it yourself.

Granted that's not the most convenient. Another interesting suggestion I came across while searching around for this issue was that you could dynamically generate a .pac file (proxy-auto config) and use Firefox's network.proxy.autoconfig_url to point to a script that returns the desired proxy information based on your subnet.

share|improve this answer

I had the same problems and wrote a script that does exactly what you want to achieve. I am running a small, low footprint local proxy that is automatically reconfigured as soon as my laptop gets a new IP address.

I have described the setup on my blog, where you can also download the script.

share|improve this answer

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.