Solved:How to Configure Proxy Settings on CentOS / RHEL / Fedora Linux

Scenario 1: To access Internet from the Private Cloud Lab to install packages for CentOS / RHEL / Fedora Linux with Yum.

Yum repositories can be accessed and used to install required packages through standard web proxy servers over HTTP/1.1. There is a proxy server and we need to somehow get through it legally to access packages to install different applications / software.
Configure Proxy Settings on CentOS / RHEL / Fedora Linux

 To use yum operations / execute yum commands, we need to specify proxy server details in /etc/yum.conf.
Following settings need to be done:

Login as root user in the terminal and execute vi /etc/yum.conf

Add the following settings in [main] section
# The proxy server 
# The account details for yum connections

To enable proxy access, do following settings in ~/.bash_profile

export http_proxy

Scenario 2: Configure wget to use a proxy server CentOS / RHEL / Fedora Linux

Login and su to root or Login as a root

Verify if environment variable is already set or not using grep command
env | grep -i “proxy”

If it provides old values set into the variables then remove it using unset <env_variable_name>

Now set Environment variable with correct values:

export http_proxy=”<<proxy_url:port>>”

To set Environment variable with user name and password:

export http_proxy=”http://username:password@proxy_url:port”

Make sure that your password must not have “@” character.

We can set it in etc/wgetrc file


Labels: ,