sudo vi /etc/profile
Add the following
export http_proxy=http://xxx.xxx.xxx.xxx:xxxx/
export https_proxy=${http_proxy}
export HTTP_PROXY=${http_proxy}
export HTTPS_PROXY=${https_proxy}
export DOCKER_HOST_IP=172.17.0.1
export no_proxy=172.17.0.0/16
export NO_PROXY=${no_proxy}
Set 172.17.0.0/16
to no_proxy
so that communication between nodes of kubernetes does not go through the proxy. (172.17.0.1 is sufficient if you use only Docker) Also, if there are other IP addresses that you do not want to go through the proxy in the local environment, separate them with ",". This point is also common to other setting items.
Reflect the changes.
source /etc/profile
sudo vi /etc/apt/apt.conf
Described below
Acquire::http::Proxy "http://xxx.xxx.xxx.xxxx:xxxx";
Acquire::https::Proxy "http://xxx.xxx.xxx.xxx:xxxx";
vi ~/.curlrc
Described below
proxy = "http://xxx.xxx.xxx.xxx:xxx/"
noproxy = "172.17.0.0/16"
sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
Described below
[Service]
Environment="HTTP_PROXY=http://xxx.xxx.xxx.xxx:xxxx/"
Environment="HTTPS_PROXY=http://xxx.xxx.xxx.xxx:xxx/"
Environment="NO_PROXY=172.17.0.0/16"
vi ~/.docker/config.json
Described below
{
"proxies":
{
"default":
{
"httpProxy": "http://xxx.xxx.xxx.xxx:xxxx",
"httpsProxy": "http://xxx.xxx.xxx.xxx:xxxx",
"noProxy": "172.17.0.0/16"
}
}
}
Reflect changes
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo vi ~/.ssh/config
Describe the following (if you want to access [email protected]:yyyy
with ssh -T example
)
Also, if you're having trouble resolving your example.com domain name, look up your IP address.
And write it directly.
Host example
User hoge
HostName example.com
Port yyyy
ProxyCommand connect -H http://xxx.xxx.xxx.xxx:xxxx %h %p
IdentityFile ~/.ssh/id_rsa_pub
Recommended Posts