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)

    e.g.

#export http_proxy=http://10.10.10.1:3128
#export ftp_proxy=http://10.10.10.1:3128


What if you have login credentials for Proxy then,

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

    e.g.

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


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

Comments

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

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

      Delete

Post a Comment

Popular posts from this blog

Recover or restore initramfs file in RHEL or CentOS 7

Space reclamation / UNMAP on RHEL or CentOS 7

How to recover /boot partition on RHEL or CentOS 7?