Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP Relay 一直没成功 #27

Closed
soffchen opened this issue Jan 21, 2016 · 3 comments
Closed

UDP Relay 一直没成功 #27

soffchen opened this issue Jan 21, 2016 · 3 comments
Labels

Comments

@soffchen
Copy link
Contributor

base {
        log_debug = off;
        log_info = off;
        log = "file:/var/log/redsocks.log";
        daemon = on;
        redirector = iptables;
}

redudp {
        local_ip = 127.0.0.1;
        local_port = 1053;
        ip = 127.0.0.1;
        port = 19443;
        type = socks5;
        dest_ip = 8.8.8.8;
        dest_port = 53;
        udp_timeout = 3;
}

使用gost -L=:19443的时候,成功解析了

# dig -p 1053 www.youtube.com @127.0.0.1

; <<>> DiG 9.9.5-3-Ubuntu <<>> -p 1053 www.youtube.com @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21979
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 5

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.youtube.com.               IN      A

;; ANSWER SECTION:
www.youtube.com.        22890   IN      CNAME   youtube-ui.l.google.com.
youtube-ui.l.google.com. 5      IN      CNAME   youtube-ui-china.l.google.com.
youtube-ui-china.l.google.com. 154 IN   A       159.106.121.75

;; AUTHORITY SECTION:
google.com.             22020   IN      NS      ns2.google.com.
google.com.             22020   IN      NS      ns3.google.com.
google.com.             22020   IN      NS      ns4.google.com.
google.com.             22020   IN      NS      ns1.google.com.

;; ADDITIONAL SECTION:
ns1.google.com.         194821  IN      A       216.239.32.10
ns3.google.com.         194823  IN      A       216.239.36.10
ns2.google.com.         194826  IN      A       216.239.34.10
ns4.google.com.         194822  IN      A       216.239.38.10

;; Query time: 8 msec
;; SERVER: 127.0.0.1#1053(127.0.0.1)
;; WHEN: Thu Jan 21 14:51:59 GMT 2016
;; MSG SIZE  rcvd: 261

使用gost -L=:19443 -F=socks+wss://ip:port或者gost -L=:19443 -F=socks://ip:port

# dig -p 1053 www.youtube.com @127.0.0.1

; <<>> DiG 9.9.5-3-Ubuntu <<>> -p 1053 www.youtube.com @127.0.0.1
;; global options: +cmd
;; connection timed out; no servers could be reached

redsocks 报错:

1453387908.288028 socks5-udp.c:381 socks5_relay_error(...) [127.0.0.1:55036->8.8.8.8:53]: socks5_relay_error
1453387942.866162 socks5-udp.c:381 socks5_relay_error(...) [127.0.0.1:26411->8.8.8.8:53]: socks5_relay_error
1453387947.907073 socks5-udp.c:381 socks5_relay_error(...) [127.0.0.1:26411->8.8.8.8:53]: socks5_relay_error
1453387952.859461 socks5-udp.c:381 socks5_relay_error(...) [127.0.0.1:26411->8.8.8.8:53]: socks5_relay_error
@ginuerzh ginuerzh added the bug label Jan 22, 2016
@smounives
Copy link

我也碰到同样问题,UDP转发一直不成功,不管用啥协议组合,日志如下
I0122 09:36:16.488647 329 conn.go:75] 10.240.0.126:59700 connected, connections: 1
I0122 09:36:16.547964 329 socks.go:85] 5 3 [0 2 128]
I0122 09:36:16.548124 329 socks.go:109] 5 128
I0122 09:36:16.742482 329 socks.go:160] 5 3 0 1 0.0.0.0:0
I0122 09:36:16.742548 329 socks.go:197] [socks5] UDP ASSOCIATE 0.0.0.0:0
I0122 09:36:16.742636 329 socks.go:214] [socks5] UDP listen on 172.17.3.93:43196
I0122 09:36:16.742753 329 socks.go:221] 5 0 0 1 172.17.3.93:43196
I0122 09:36:16.804099 329 socks.go:417] [udp] tunnel
I0122 09:36:16.804150 329 socks.go:229] [udp] to 114.114.114.114:53, length 26
I0122 09:36:46.804553 329 socks.go:248] socks5 udp: read udp [::]:43196: i/o timeout
I0122 09:36:46.804764 329 conn.go:80] 10.240.0.126:59700 disconnected, connections: 0

@smounives
Copy link

今天又试了一下,IPv6同样也不支持UDP转发,socks5协议,其他协议和组合协议一样不能,日志如下
I0124 00:11:12.228714 11224 socks.go:197] [socks5] UDP ASSOCIATE 0.0.0.0:0
I0124 00:11:12.231715 11224 socks.go:214] [socks5] UDP listen on 127.0.0.1:57797
I0124 00:11:12.232714 11224 socks.go:221] 5 0 0 1 127.0.0.1:57797
I0124 00:11:12.235715 11224 socks.go:414] [udp] client 127.0.0.1:57798
I0124 00:11:12.236716 11224 socks.go:229] [udp] to 114.114.114.114:53, length 26
I0124 00:11:12.579764 11224 conn.go:251] forward: socks/tcp [2402:XXXX:X:XXXX::2:5dd6]:10800
I0124 00:11:12.918558 11224 socks.go:439] forward udp associate
I0124 00:11:13.620790 11224 socks.go:446] 5 3 0 0 :0

ginuerzh pushed a commit that referenced this issue Feb 5, 2016
@soffchen
Copy link
Contributor Author

soffchen commented Feb 5, 2016

rc3 测试 ok 了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants