一、为系统设置代理
编辑文件/etc/profile,增加如下两行
vim /etc/profile export http_proxy=http://your_proxy_server:port export https_proxy=https://your_proxy_server:port export ALL_PROXY=https://your_proxy_server:port #指定不需要走代理的特定IP地址或者域名 export no_proxy="localhost,127.0.0.1,特定IP1,特定IP2"
更新环境文件:
source /etc/profile
二、为yum配置代理
vim /etc/yum.conf [main] ... proxy=http://your_proxy_server:port #特定的IP不走代理,编辑/etc/yum.conf文件,找到[main]部分,然后添加或修改exclude参数 [main] ... proxy=http://your_proxy_server:port ... exclude=ip_address_or_domain1,ip_address_or_domain2
三、为wget代理设置
编辑文件为:/etc/wgetrc 添加下面两行:
vim /etc/wgetrc http_proxy=http://proxy.com:8080/ https_proxy=http://proxy.com:8080/ #特定的IP地址不走代理 no_proxy = localhost,127.0.0.1,,特定IP1,特定IP2
Linux代理
于 2022-07-06 13:54:36 首次发布