7.6. Using an HTTP Proxy

Some network environments may only allow external Internet access or access to content servers by going through an HTTP proxy.

7.6.1. Configuring an HTTP Proxy in the UI

Subscription Manager can be configured to use an HTTP proxy for all of its connections to the subscription service. (This is also an advanced configuration option at firstboot.) To configure the proxy:
  1. Launch Subscription Manager. For example:
    [root@server ~]# subscription-manager-gui
  2. Open the System menu, and select the Configure Proxy item.
  3. Check the ...Connect to Red Hat Network via an HTTP Proxy checkbox and enter the server location, in the format hostname:port.
  4. If the proxy requires a username/password to allow access, then also select the authentication checkbox and fill in the user credentials.
  5. The configuration is automatically applied, so when the proxy is configured, simply close the window.

7.6.2. Configuring HTTP Proxy in the CLI

The HTTP proxy settings can be configured in the rhsm.conf file; this is the same as configuring it in the Subscription Manager GUI. The proxy configuration is stored and used for every connection between the subscription service and the local system.
[root@server1 ~]# subscription-manager config --server.proxy_hostname=proxy.example.com --server.proxy_port=8080 --server.proxy_user=admin --server.proxy_password=secret
All the proxy parameters are described in Table 7, “rhsm.conf Parameters”. There are four parameters directly related to the HTTP proxy:
  • proxy_hostname for the IP address or fully-qualified domain name of the proxy server; this is required.

    Note

    Leaving the proxy_hostname argument blank means that no HTTP proxy is used.
  • proxy_port for the proxy server port.
  • proxy_user for the user account to connect to the proxy; this may not be required, depending on the proxy server's configuration.
  • proxy_password for the password for the user account to connect to the proxy; this may not be required, depending on the proxy server's configuration.

7.6.3. Passing HTTP Proxy Information with subscription-manager Commands

Rather than using a permanently-configured HTTP proxy, as the GUI does, HTTP proxy information can be passed with a command invocations. The arguments listed in Table 8, “Proxy Arguments” are available to every command used with subscription-manager.

Table 8. Proxy Arguments

Argument Description Required for a Proxy Connection?
--proxy Gives the proxy server to connect to, in the format hostname:port. Yes
--proxyuser Gives the username to use to authenticate. This is only required if user authentication is required. No
--proxypassword Gives the password to use with the user account. This is only required if user authentication is required. No
The proxy information can be passed with any subscription-manager operation. For example:
[root@server1 ~]# subscription-manager attach --pool=ff8080812bc382e3012bc3845ca000cb --proxy=proxy.example.com:8443 --proxyuser=jsmith --proxypassword=secret