【Debian】設定代理伺服器
阿新 • • 發佈:2019-02-06
注意所有ip都要加上http://
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases Go in /etc/bashrc
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";
#注意分號