Friday, December 31, 2010

How to set proxy settings on RHEL OR CentOS ?

How to set proxy settings on RHEL OR CentOS ?

What you will do if you dont have direct internet connection & you want to download some package or file by wget suppose. In this scenario we have to set proxy server settings for HTTP as well as FTP traffic.

1. Get full information about the Proxy server & your access account on it like,

A. Proxy Server IP OR Hostname
B. Proxy Port Number
C. Login cridentials if any
D. Ask if admin managing different accounts & server info for HTTP & FTP access.

Now here we go, We can do this thing in two manner one is Temporary & other is Permanent setting,

To do this on temporary basis, we will set this info in environment variable;

#export http_proxy=http://<Proxy Server IP>:<Proxy Port No.> (For HTTP Proxy)
#export ftp_proxy=http://<Proxy Server IP>:<Proxy Port No.> (For FTP Proxy)


#export http_proxy=
#export ftp_proxy=

What if you have login credentials for Proxy then,

#export http_proxy=http://username:password@<Proxy Server IP>:<Proxy Port No.>


#export http_proxy=http://ashish:ashish123@

Note : These command will set proxy temporary, if you want to make it Permanently then, add these settings in "~/.bashrc" file.


  1. Hi Ashish, I tried the above in RHEL 6. It is not working through CLI. Works only through GUI.
    Could you please help?

    1. You probably have a special character in your password that is causing ssues.

  2. I really appreciate this blog and I will sure promote this blog to others in my circle
    access Mp3lemon in UK