分享知识,分享快乐

0%

centos7 简单开启代理上网

centos7 简单开启代理上网

服务端安装: 在可以上网的机器安装

1
2
yum install squid -y
systemctl restart squid

客户端安装

yum 配置代理

1
echo "proxy=http://IP:3128/" >> /etc/yum.conf

系统全局代理(我测试下来,yum 不能用 )

vi /etc/profile

1
2
3
# export all_proxy=http://IP:3128  只导入这个 ,测试下来wget不能用
export http_proxy=http://IP:3128
export https_proxy=http://IP:3128
1
2
3
测试代理是否生效
curl http://myip.ipip.net
curl https://myip.ipip.net/