Jan 3, 2013

Set proxy settings on Linux systems


If a system is connected to the internet via a proxy server, we need to give those information to the system. To do that, can use ' /etc/environment ' file to set system wide proxy settings.

You just need to add the proxy server IP or the domain name and the port number.
http_proxy=proxysvr.local:3128
https_proxy=proxysvr.local:3128
ftp_proxy=proxysvr.local:3128

if you need to avoid some hosts going through the proxy server you need to add this;
no_proxy="localhost,127.0.0.1,localaddress,.server.local"

Some software products refer to the upper case of those variables therefore it is better to use the upper case copy of the same settings.
HTTP_PROXY=proxysvr.local:3128
HTTPS_PROXY=proxysvr.local:3128
FTP_PROXY=proxysvr.local:3128
NO_PROXY="localhost,127.0.0.1,localaddress,.server.local"


Note:-
Event though you add proxy settings in this, some tools like apt-get will not work. In such a case you need to refer the configurations guide of that tool.
You can set user specific proxy settings by settings those environment variables in '~/.bash_profile' file.

2 comments:

Your comments are always welcome ...