【Debian】设置代理服务器

来源:互联网 发布:cat鞋子知乎 编辑:程序博客网 时间:2024/05/29 00:33

注意所有ip都要加上http://

# /etc/profile

# System wide environment and startupprograms, for login setup

# Functions and aliases Go in/etc/bashrc

ftp_proxy="http://192.168.10.209:3128"    

http_proxy="http://192.168.10.209:3128"

https_proxy="http://192.168.10.209:3128"

no_proxy="localhost,127.0.0.1,192.168.10.0/24"

export ftp_proxy

export http_proxy

export https_proxy

export no_proxy

 

注意,若是使用的复制,需要用vi打开删除不识别的^m符号。

 

添加完后重启系统即可。这时所有的网络连接均通过代理来联网。

测试方法:

# wget “www.baidu.com”

–2011-09-06 07:29:17– http://www.baidu.com/
Connecting to 192.168.10.209:3128… connected.
Proxy request sent, awaiting response… 200 OK
Length: 81 [text/html]
Saving to: `index.html’

100%[====================================>]81         –.-K/s   in 0s

2011-09-06 07:29:17 (7.72 MB/s) –`index.html’ saved [81/81]


也可仅仅修改 apt的代理
/etc/apt/apt.conf
   Acquire::http::Proxy "http://192.168.10.209:3128";  #注意分号

0 0
原创粉丝点击