1

I've set up a squid forward proxy to cache all internet requests. I have a public ip and opened port 3128. Now I just need to set my ubuntu server to force all internet connections to pass through this proxy, using the ip address and port number.

I know this command which will make ubuntu access the internet via a proxy, but I was told it wasn't permanent.

export http_proxy="http://proxy.example.com:8080"

Which command do I need to use to force ubuntu to go through this proxy regardless of reboots or sessions?

Thanks

1

Instead of doing an export, put this in file /etc/environment:

http_proxy="http://proxy.example.com:8080"
https_proxy="http://proxy.example.com:8080"
ftp_proxy="http://proxy.example.com:8080"
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
HTTP_PROXY="http://proxy.example.com:8080"
HTTPS_PROXY="http://proxy.example.com:8080"
FTP_PROXY="http://proxy.example.com:8080"
NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"

and reboot your server/vm.

  • do we still need to configure url in the browser to access internet through proxy ?? ( eq. inside firefox settings > Configure proxies to access internet ) – pkm Aug 5 '17 at 10:33
0

fter some googling. i was able to fix this:

original: /etc/apt/apt.conf

    Acquire::http::Proxy "xx.xx.xx.xx:8080";

modified apt.conf

/etc/apt/apt.conf

    Acquire::http::Proxy "http://xx.xx.xx.xx:8080";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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