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

[Bug] tproxy:// fails to proccess IPv6 connections #290

Closed
phantomcraft opened this issue Oct 12, 2021 · 8 comments
Closed

[Bug] tproxy:// fails to proccess IPv6 connections #290

phantomcraft opened this issue Oct 12, 2021 · 8 comments
Labels

Comments

@phantomcraft
Copy link

Easy to reproduce:

ip netns add nsx
ip li add vethx type veth peer name peerx netns nsx
ip li set vethx up
ip -6 addr add fd00::1/64 dev vethx
ip netns exec nsx ip li set lo up
ip netns exec nsx ip li set peerx up
ip -6 netns exec nsx ip addr add fd00::2/64 dev peerx
ip netns exec nsx ip -6 route add default via fd00::1 dev peerx

ip -6 rule add fwmark 1088 table 100
ip -6 route add local default dev vethx table 100

ip6tables -t mangle -A PREROUTING -i vethx -p udp -j TPROXY -s fd00::2 --on-ip fd00::1 --on-port 10000 --tproxy-mark 1088

============================================

root@localhost:/home/user# glider -verbose -listen tproxy://[fd00::1]:10000 -forward socks5://127.0.0.1:9000
2021/10/11 21:38:25 group.go:186: [group] only 1 forwarder found, disable health checking
2021/10/11 21:38:25 server.go:78: [tproxyu] listening UDP on [fd00::1]:10000
2021/10/11 21:38:25 server.go:78: [tproxyu] listening UDP on 10.0.0.1:10000
2021/10/11 21:39:00 server.go:84: [tproxyu] read error: unable to obtain original destination: %!s(<nil>)
2021/10/11 21:39:05 server.go:84: [tproxyu] read error: unable to obtain original destination: %!s(<nil>)
2021/10/11 21:39:10 server.go:84: [tproxyu] read error: unable to obtain original destination: %!s(<nil>)

=============================================

root@localhost:/home/user# ip netns exec nsx dig @2606:4700:4700::1111 g.co
; <<>> DiG 9.16.15-Debian <<>> @2606:4700:4700::1111 g.co
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
nadoo added a commit that referenced this issue Oct 22, 2021
@phantomcraft
Copy link
Author

phantomcraft commented Oct 22, 2021

This other issue is related to IPv6 too: #291

I will compile and test later to see if your commit solved the provbem.

@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jan 21, 2022
@phantomcraft
Copy link
Author

@nadoo

I tested here, it not works yet:

root@localhost:/home/user# glider -verbose -listen tproxy://[fd00::1]:10000 -forward socks5://127.0.0.1:9000
2022/01/20 21:56:25 group.go:191: [group] main: only 1 forwarder found, disable health checking
2022/01/20 21:56:25 server.go:78: [tproxyu] listening UDP on [fd00::1]:10000
2022/01/20 21:56:35 server.go:84: [tproxyu] read error: unable to obtain original destination: %!s(<nil>)
2022/01/20 21:56:40 server.go:84: [tproxyu] read error: unable to obtain original destination: %!s(<nil>)
2022/01/20 21:56:45 server.go:84: [tproxyu] read error: unable to obtain original destination: %!s(<nil>)
root@localhost:/home/user# ip netns exec nsx dig @2606:4700:4700::1111 g.co

; <<>> DiG 9.17.21-1-Debian <<>> @2606:4700:4700::1111 g.co
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

@github-actions github-actions bot removed the Stale label Jan 22, 2022
nadoo added a commit that referenced this issue Jan 24, 2022
@nadoo
Copy link
Owner

nadoo commented Jan 24, 2022

Hi @phantomcraft , you can try the attachment to see whether it fixed..
glider-dev-linux-amd64.zip

@phantomcraft
Copy link
Author

Not yet:

root@localhost:/home/user# /dev/shm/glider -verbose -listen tproxy://[fd00::1]:10000 -forward socks5://127.0.0.1:9000
2022/01/24 15:53:15 group.go:191: [group] main: only 1 forwarder found, disable health checking
2022/01/24 15:53:15 server.go:78: [tproxyu] listening UDP on [fd00::1]:10000
2022/01/24 15:53:31 server.go:84: [tproxyu] read error: unable to obtain original destination: %!s(<nil>)
2022/01/24 15:53:36 server.go:84: [tproxyu] read error: unable to obtain original destination: %!s(<nil>)
2022/01/24 15:53:41 server.go:84: [tproxyu] read error: unable to obtain original destination: %!s(<nil>)
root@localhost:/home/user# ip netns exec nsx dig @2606:4700:4700::1111 g.co
; <<>> DiG 9.17.21-1-Debian <<>> @2606:4700:4700::1111 g.co
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

nadoo added a commit that referenced this issue Jan 25, 2022
@nadoo
Copy link
Owner

nadoo commented Jan 25, 2022

Sorry, now it should be fixed.
glider-dev-linux-amd64.zip

@phantomcraft
Copy link
Author

@nadoo

I believe now it works:


root@localhost:/home/user# /dev/shm/glider -verbose -listen tproxy://[fd00::1]:10000 -forward socks5://127.0.0.1:9000
2022/01/25 19:07:22 group.go:191: [group] main: only 1 forwarder found, disable health checking
2022/01/25 19:07:22 server.go:78: [tproxyu] listening UDP on [fd00::1]:10000
2022/01/25 19:07:46 server.go:108: [tproxyu] dial to [2606:4700:4700::1111]:53 error: proxy: failed to read greeting from SOCKS5 proxy at 127.0.0.1:9000: EOF
2022/01/25 19:07:50 server.go:108: [tproxyu] dial to [2606:4700:4700::1111]:53 error: proxy: failed to read greeting from SOCKS5 proxy at 127.0.0.1:9000: EOF
2022/01/25 19:07:56 server.go:108: [tproxyu] dial to [2606:4700:4700::1111]:53 error: proxy: failed to read greeting from SOCKS5 proxy at 127.0.0.1:9000: EOF
root@localhost:/home/user# ip netns exec nsx dig @2606:4700:4700::1111 g.co
; <<>> DiG 9.17.21-1-Debian <<>> @2606:4700:4700::1111 g.co
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

Sorry, I don't have IPv6 connectivity at the moment, all that I can see is that the connection reached Glider. I think this is enough.

If this resolves this issue, you can close it.

@nadoo nadoo added the bug label Jan 26, 2022
@nadoo
Copy link
Owner

nadoo commented Jan 26, 2022

Thanks for your testing! Feel free to reopen this issue when there's still any problem.

@nadoo nadoo closed this as completed Jan 26, 2022
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

2 participants