Proxy Settings
Proxy Environment Variables
Global proxy environment variables are defined in /etc/profile.d/proxy.sh
in CentOS. These variables can also be set at the user level in ~/.bashrc
.
export http_proxy=http://wwwproxy.uni-muenster.de:3128
export https_proxy=http://wwwproxy.uni-muenster.de:3128
export no_proxy="localhost,127.0.0.1,0.0.0.0,.wwu.de,.uni-muenster.de,.wwu.io,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16"
Note: sudo
must be called with the parameter -E
to preserve the environment variables of the current user.
However, this includes variables like $HOME
, which may have unwanted side effects.
Packagemanager Yum and DNF
The following line must be included in /etc/yum.conf
or /etc/dnf/dnf.conf
depending on which you use:
proxy = http://wwwproxy.uni-muenster.de:3128
Packagemanager APT
To configure the proxy for APT, include the following line in the apt.conf
file.
This can be done, for example, with the following command:
echo 'Acquire::http::Proxy "http://wwwproxy.uni-muenster.de:3128";' > /etc/apt/apt.conf.d/10proxy
Docker
The proxy settings for docker must be configured in /etc/systemd/system/docker.service.d/10-proxy.conf
:
[Service]
Environment="http_proxy=http://wwwproxy.uni-muenster.de:3128" "https_proxy=http://wwwproxy.uni-muenster.de:3128" "no_proxy=localhost,127.0.0.1,0.0.0.0,.wwu.de,.uni-muenster.de,.wwu.io,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16"
The docker service must be restarted via systemctl daemon-reload && systemctl restart docker
for the new settings to take effect.