1. 程式人生 > >Ubuntu16.04配置命令代理和禁用ipv6

Ubuntu16.04配置命令代理和禁用ipv6

1.配置命令代理

sudo apt-get install polipo
logSyslog = true
logFile = /var/log/polipo/polipo.log
proxyAddress = "0.0.0.0"
socksParentProxy = "127.0.0.1:1080"
socksProxyType = socks5
chunkHighMark = 50331648
objectHighMark = 16384
serverMaxSlots = 64
serverSlots = 16
serverSlots1 = 32

重啟polipo服務

sudo /etc/init.d/polipo restart
export http_proxy="http://127.0.0.1:8123/"
curl ip.gs
curl www.google.com

命令視窗重新開啟後,以下命令需要重新執行:

export http_proxy="http://127.0.0.1:8123/"

2.禁用ipv6

vim /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
sudo sysctl -p

將會顯示:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
cat /proc/sys/net/ipv6/conf/all/disable_ipv6

顯示:

1

則成功禁用ipv6

參考:

https://askubuntu.com/questions/440649/how-to-disable-ipv6-in-ubuntu-14-04

https://jingsam.github.io/2016/05/08/setup-shadowsocks-http-proxy-on-ubuntu-server.html