服务热线:0838-3644370

我们没什么了不起! (除了海外服务器)

CentOS7配置代理上网 2020年9月14日 运维技术 < 文章文档 < 首页

CentOS7配置代理上网

1.wget 配置文件设置代理(这步可能没用,如果后面两步不行,再加上这个步骤)

vim ~/.wgetrc

http_proxy=http://192.168.1.26:3128

https_proxy=http://192.168.1.26:3128

use_proxy = on

wait = 30

wget -T 30 --tries 3 http://192.168.1.26:3128

2.Yum源代理

  vi /etc/yum.conf,添加红色部份:

[main]

cachedir=/var/cache/yum/basearch/basearch/releasever

keepcache=0

debuglevel=2

logfile=/var/log/yum.log

exactarch=1

obsoletes=1

gpgcheck=1

plugins=1

installonly_limit=5

bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum

distroverpkg=centos-release

proxy=http://192.168.1.26:3128

3.修改系统全局代理(代理如果没有设置用户名和密码,下面那两行可以去掉)

  VIM  /etc/profile

http_proxy=http:// 192.168.1.26:3128

https_proxy=http:// 192.168.1.26:3128

proxy_username='*******'

proxy_password='*******'

export http_proxy

export https_prox


相关专题: centos