首先開放squid的默認端口,方法如上。html
服務器:git
安裝squid: yum install squid vim
修改配置文件: vi /etc/squid/squid.conf 服務器
客戶端:ui
修改yum代理: vim /etc/yum.conf 加入 proxy=http://ip:port/ spa
修改wget代理: vim /etc/wgetrc 加入 http_proxy=http://ip:port/ 代理
https_proxy=https://ip:port/ code
ftp_proxy=http://ip:port/ htm
修改環境變量: vim /etc/profile 加入 export http_proxy=http://ip:port/ blog
export ftp_proxy=http://ip:port
備註:環境變量的代理配置會影響Kubernetes組件之間的通訊。若是想使用Kubernetes,應取消環境變量的相關設置。
修改git代理: git config --global http.proxy http://ip:port
git config --global https.proxy https://ip:port
取消命令: git config --global --unset http.proxy
git config --global --unset https.proxy