Centos 设置代理

1、网页上网

网页上网设置代理在浏览器下 Edit-->>Preferences-->>Advanced-->>Network

在Connection下点击Settings,里面的manual proxy configuration里设置IP和PORT即可

2、yum代理设置

编辑文件为:/etc/yum.conf 

在里面添加这一行:proxy=IP:PORT

这里的IP 为你要设置的IP ,PORT 是你要设置的端口

 

3、wget代理设置

编辑文件为:/etc/wgetrc      添加下面两行: http_proxy = IP:PORT   ftp_proxy = IP:PORT

4、系统环境代理设置

编辑文件为/etc/profile,如果只想给自己的账户设置,则编辑~/.bashrc即可

添加三# add proxy for network
export http_proxy="http://www.baidu.com:8080"   #根据实际代理名称填写
export https_proxy="http://www.baidu.com:8080"
export ftp_proxy=$http_proxy

然后source /etc/profile 或者source ~/.bashrc即可行:

注:如果采用两块网卡,记得只能设置一个网卡的gateway。两个gateway均生效的情况会造成网络连接不通。vim /etc/sysconfig/network-scripts/ifcfg-eth1

 

posted on 2017-01-11 11:17  明明叨叨  阅读(530)  评论(1编辑  收藏  举报

导航