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

IPv6 doesn't work when using GOST with red:// and netns options #598

Open
przemyslaw0 opened this issue Oct 20, 2024 · 0 comments
Open

IPv6 doesn't work when using GOST with red:// and netns options #598

przemyslaw0 opened this issue Oct 20, 2024 · 0 comments

Comments

@przemyslaw0
Copy link

Easy to reproduce:

ip netns add blah
ip netns exec blah ip link add d0 type dummy
ip netns exec blah ip link set d0 up
ip netns exec blah ip -4 addr add 10.0.0.1 dev d0
ip netns exec blah ip -6 addr add fc00::1 dev d0
ip netns exec blah ip -4 route add default dev d0
ip netns exec blah ip -6 route add default dev d0
ip netns exec blah ip link set lo up
ip netns exec blah iptables -t nat -A OUTPUT -p tcp -s 10.0.0.1 --syn -j REDIRECT --to-ports 9040
ip netns exec blah ip6tables -t nat -A OUTPUT -p tcp -s fc00::1 --syn -j REDIRECT --to-ports 9040

ip netns exec blah gost -L "red://127.0.0.1:9040" -L "red://[::1]:9040" -F "socks5://127.0.0.1:1080?netns=/proc/1/ns/net"

IPv4 works:

# ip netns exec blah curl 1.1.1.1
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>cloudflare</center>
</body>
</html>

But IPv6 doesn't:

# time ip netns exec blah curl http://[2606:4700:4700::1111]
^C

real	0m32.745s
user	0m0.003s
sys	0m0.005s

Socks5 Log:

V2Ray 5.16.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.22.2 linux/amd64)
A unified platform for anti-censorship.
2024/10/19 20:12:03 tcp:127.0.0.1:47594 accepted tcp:1.1.1.1:80 [proxy]
2024/10/19 20:12:12 tcp:127.0.0.1:57020 accepted tcp:[2606:4700:4700::1111]:20480 [proxy]

GOST Log:

# ip netns exec blah gost -L "red://127.0.0.1:9040" -L "red://[::1]:9040" -F "socks5://127.0.0.1:1080?netns=/proc/1/ns/net"
{"handler":"red","kind":"service","level":"info","listener":"red","msg":"listening on 127.0.0.1:9040/tcp","service":"service-0","time":"2024-10-19T20:11:56.519-04:00"}
{"handler":"red","kind":"service","level":"info","listener":"red","msg":"listening on [::1]:9040/tcp","service":"service-1","time":"2024-10-19T20:11:56.519-04:00"}
{"handler":"red","kind":"handler","level":"info","listener":"red","local":"127.0.0.1:9040","msg":"10.0.0.1:36912 <> 127.0.0.1:9040","remote":"10.0.0.1:36912","service":"service-0","sid":"csa4lkun0d534a8ok27g","time":"2024-10-19T20:12:03.725-04:00"}
{"dst":"1.1.1.1:80/tcp","handler":"red","host":"1.1.1.1:80","kind":"handler","level":"info","listener":"red","local":"127.0.0.1:9040","msg":"10.0.0.1:36912 <-> 1.1.1.1:80","remote":"10.0.0.1:36912","service":"service-0","sid":"csa4lkun0d534a8ok27g","time":"2024-10-19T20:12:03.726-04:00"}
{"dst":"1.1.1.1:80/tcp","duration":2188351045,"handler":"red","host":"1.1.1.1:80","kind":"handler","level":"info","listener":"red","local":"127.0.0.1:9040","msg":"10.0.0.1:36912 >-< 1.1.1.1:80","remote":"10.0.0.1:36912","service":"service-0","sid":"csa4lkun0d534a8ok27g","time":"2024-10-19T20:12:05.914-04:00"}
{"dst":"1.1.1.1:80/tcp","duration":2188960474,"handler":"red","host":"1.1.1.1:80","inputBytes":71,"kind":"handler","level":"info","listener":"red","local":"127.0.0.1:9040","msg":"10.0.0.1:36912 >< 127.0.0.1:9040","outputBytes":386,"remote":"10.0.0.1:36912","service":"service-0","sid":"csa4lkun0d534a8ok27g","time":"2024-10-19T20:12:05.914-04:00"}
{"handler":"red","kind":"handler","level":"info","listener":"red","local":"[::1]:9040","msg":"[fc00::1]:42586 <> [::1]:9040","remote":"[fc00::1]:42586","service":"service-1","sid":"csa4ln6n0d534a8ok280","time":"2024-10-19T20:12:12.222-04:00"}
{"dst":"[2606:4700:4700::1111]:20480/tcp","handler":"red","host":"[2606:4700:4700::1111]:20480","kind":"handler","level":"info","listener":"red","local":"[::1]:9040","msg":"[fc00::1]:42586 <-> [2606:4700:4700::1111]:20480","remote":"[fc00::1]:42586","service":"service-1","sid":"csa4ln6n0d534a8ok280","time":"2024-10-19T20:12:12.222-04:00"}
{"dst":"[2606:4700:4700::1111]:20480/tcp","duration":59192655697,"handler":"red","host":"[2606:4700:4700::1111]:20480","kind":"handler","level":"info","listener":"red","local":"[::1]:9040","msg":"[fc00::1]:42586 >-< [2606:4700:4700::1111]:20480","remote":"[fc00::1]:42586","service":"service-1","sid":"csa4ln6n0d534a8ok280","time":"2024-10-19T20:13:11.415-04:00"}
{"dst":"[2606:4700:4700::1111]:20480/tcp","duration":59193217513,"handler":"red","host":"[2606:4700:4700::1111]:20480","inputBytes":86,"kind":"handler","level":"info","listener":"red","local":"[::1]:9040","msg":"[fc00::1]:42586 >< [::1]:9040","outputBytes":0,"remote":"[fc00::1]:42586","service":"service-1","sid":"csa4ln6n0d534a8ok280","time":"2024-10-19T20:13:11.415-04:00"}

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

No branches or pull requests

1 participant