Closed sbilly closed 5 years ago
https://github.com/FlowerWrong/ip2socks/blob/master/src/udp_raw.cpp#L427
relay_none_dns_packet_with_udp: true
试试这个。
把 relay_none_dns_packet_with_udp
配置成了 true
也无法正常工作
# ntpdate time.windows.com
13 Feb 06:44:48 ntpdate[1868]: no server suitable for synchronization found
# tcpdump -n -i tun0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type RAW (Raw IP), capture size 262144 bytes
06:44:40.573645 IP 10.0.0.1.123 > 52.179.17.38.123: NTPv4, Client, length 48
06:44:42.573617 IP 10.0.0.1.123 > 52.179.17.38.123: NTPv4, Client, length 48
06:44:44.526891 IP6 fe80::1288:d43d:4929:4231 > ff02::2: ICMP6, router solicitation, length 8
06:44:44.573435 IP 10.0.0.1.123 > 52.179.17.38.123: NTPv4, Client, length 48
06:44:46.573310 IP 10.0.0.1.123 > 52.179.17.38.123: NTPv4, Client, length 48
之前启动的 ip2socks 提示 udp query sendto failed
# ./ip2socks --config=./scripts/config.linux.example.yml
Lwip netstack host 10.0.0.2 mask 255.255.255.0 gateway 10.0.0.1
Open tun device: tun0 for reading...
tun name is tun0
exec setup shell sh ./scripts/linux_setup_tuntap.sh 10.0.0.1
origin gateway is '192.168.158.2'
grep: ./scripts/china_ip_list/china_ip_list.txt: No such file or directory
Ip2socks started!
UDP via socks 5 udp tunnel to 52.179.17.38
udp query sendto failed
UDP via socks 5 udp tunnel to 52.179.17.38
udp query sendto failed
UDP via socks 5 udp tunnel to 52.179.17.38
udp query sendto failed
UDP via socks 5 udp tunnel to 52.179.17.38
udp query sendto failed
修改过的 config.linux.example.yml
# cat scripts/config.linux.example.yml
ip_mode: tun # tun or tap, default tun
dns_mode: udp # tcp or udp, default tcp
socks_server: 127.0.0.1
socks_port: 1080
remote_dns_server: 8.8.8.8
remote_dns_port: 53
local_dns_port: 53 # if you use your own local dns server, eg: pdnsd, dnsmasg, this is upstream dns server.
relay_none_dns_packet_with_udp: true
custom_domian_server_file: ./scripts/block.conf;./scripts/custom_domain_server.conf;./scripts/dnsmasq-china-list/google.china.conf;./scripts/dnsmasq-china-list/apple.china.conf;./scripts/dnsmasq-china-list/accelerated-domains.china.conf; # if multi, split with ';'
gw: 10.0.0.1 # gateway of lwip netif
addr: 10.0.0.2 # ip of lwip netif
netmask: 255.255.255.0 # netmask of lwip netif
after_start_shell: './scripts/linux_setup_tuntap.sh'
before_shutdown_shell: './scripts/linux_down_tuntap.sh'
你debug看看,我现在都用 tun2socks, 这个项目基本不维护了。
我也试试 tun2socks。多谢
我删除了 china_ip_list.txt 文件,强制所有的请求都走 socks 代理。curl 已经可以正常访问 google.com,dns 是可以正常工作的,但使用 udp 协议的 ntp 却不工作。
我希望 udp 协议都能正常使用,ntp 只是我用来测试的工具。
@FlowerWrong 多谢啦