Skip to content

Instantly share code, notes, and snippets.

@insdavm
Last active May 12, 2024 03:28
Show Gist options
  • Save insdavm/90cbeffe76ba4a51251d83af604adf94 to your computer and use it in GitHub Desktop.
Save insdavm/90cbeffe76ba4a51251d83af604adf94 to your computer and use it in GitHub Desktop.
WireGuard over TCP with udptunnel

WireGuard over TCP with udptunnel

udptunnel is a small program which can tunnel UDP packets bi-directionally over a TCP connection. Its primary purpose (and original motivation) is to allow multi-media conferences to traverse a firewall which allows only outgoing TCP connections.

Server

# udptunnel -s 443 127.0.0.1/51820

Client

# udptunnel -c [SERVER PUBLIC IP]/443 127.0.0.1 50001
  • Remember to open TCP port 443 on the server's firewall
  • In the WireGuard client config file, replace the server's public IP (endpoint) with 127.0.0.1:50001
@andrew-aladjev
Copy link

andrew-aladjev commented Apr 22, 2024

@testingnic, I've made the udptunnel-1.2.0 release in my own fork with deb and rpm packages, because we can wait for @rfc1036 almost forever. You can now just download and install it.

@andrew-aladjev
Copy link

andrew-aladjev commented Apr 22, 2024

I've added here my gist with configs. I've tested it on several machines and it works perfect. Please try it.

PS From my experience TCP tunnel is a bit faster than UDP in several countries, because of QOS.

@patrickzzz
Copy link

well done so far.. although i don't like to use unmaintained software-packages for this purposes.. ;-(

@andrew-aladjev
Copy link

@patrickzzz I am also using wstunnel. It is maintainable and easy. Of course he can't bypass GFC, but it can provide good experience in any country except China.

udptunnel is required for low memory devices like old routers with openwrt. I don't really see any requirement for further udptunnel updates and maintenance.

@testingnic
Copy link

Tranks bro 💖

@andrew-aladjev
Copy link

I've made additional work on wireguard routing. You may be interested in it. Question is here, gist with route scripts and configs here.

@testingnic
Copy link

I've made additional work on wireguard routing. You may be interested in it. Question is here, gist with route scripts and configs here.

udp puncher could be added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment