因为某些原因,我需要部署一台代理服务器,之前配置了http缓存代理,但是有些网站访问异常,而且有些软件不支持http代理,所以萌生了部署SOCKS5服务。
1、安装 dante-server
1 |
sudo apt install dante-server |
2、配置
备份配置文件
1 2 |
sudo cp /etc/danted.conf /etc/danted.conf.backup sudo nano /etc/danted.conf |
查找以下关键行进行修改
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# 设置日志文件位置 # the server will log both via syslog, to stdout and to /var/log/lotsoflogs logoutput: /var/log/danted/output.log # 设置网卡和端口 # Alternatively, the interface name can be used instead of the address. internal: ens33 port = 1080 # 设置出口 # all outgoing connections from the server will use the IP address external: ens33 # 设置模式为无验证 # methods for socks-rules. method: username none #rfc931 # 设置客户端可以通过任何ip访问任何ip # This is identical to above, but allows clients without a rfc931 (ident) # too. In practise this means the socksserver will try to get a rfc931 # reply first (the above rule), if that fails, it tries this rule. client pass { from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0 log: connect disconnect } # 设置协议支持tcp和udp # everyone from our internal network, 10.0.0.0/8 is allowed to use # tcp and udp for everything else. pass { from: 0.0.0.0/0 to: 0.0.0.0/0 protocol: tcp udp log: connect disconnect } |
创建日志文件夹,并重启服务
1 2 |
sudo mkdir /var/log/danted/ sudo service danted restart |