官網:http://www.squid-cache.org/bash
安裝網絡
sudo apt install squid
配置,在 /etc/squid/squid.conf 中添加或修改:ide
# 設置匿名代理 forwarded_for delete via off # 修改監聽端口 http_port 3128 # 禁止域名訪問 http_access deny denysite .qq.com .google.com # 禁止域名訪問也能夠配文件 # http_access deny "/etc/squid/denysite.list" # 若是禁止無效,檢查下面這句命令的位置 http_access deny denysite # 容許本地網絡訪問 acl localnet src 10.0.0.0/8 # RFC1918 possible internal network acl localnet src 172.16.0.0/12 # RFC1918 possible internal network acl localnet src 192.168.0.0/16 # RFC1918 possible internal network acl localnet src fc00::/7 # RFC 4193 local private network range acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines http_access allow localnet # 去掉本地網絡訪問權限的註釋 # 自定義一個名爲walker的控制組,並容許此控制組。 acl walker src 99.0.0.0/8 # 99段的A類地址 acl walker src 5.4.3.2/32 # 單個IP地址5.4.3.2 http_access allow walker # 容許walker組 # 修改或添加 dns dns_nameservers 223.5.5.5 119.29.29.29 114.114.114.114
重啓服務ui
sudo systemctl restart squid.service # or sudo systemctl restart squid
*** walker ***google