Skip to content

Conversation

@VastBlast
Copy link

Reopening #154 as it was auto closed after restructuring my fork.

This PR adds support for a proxying a UDP server through WireGuard. It can listen on IPv4 while tunneling to an IPv6 address or vice versa.

When sending, it goes through BindAddress -> Wireguard -> Target and the opposite when receiving.

For example, if you wanted to proxy Cloudflare's DNS server, an example config would be:

[Interface]
...

[Peer]
...

[UDPProxyTunnel]
BindAddress = 127.0.0.1:53

#Target = [2606:4700:4700::1111]:53
Target = 1.1.1.1:53

# If its set to 0, it will never timeout
InactivityTimeout = 30

@shihiro09
Copy link

Love the DNS use-case. cc @whyvl

Just a thought: would this enable nested wireguard tunnels with two wireproxy daemons? e.g.

outer.conf:

[Peer]
Endpoint = [outer-tunnel]:51280
PublicKey = [outer-key]

[UDPProxyTunnel]
BindAddress = 127.0.0.1:1234
Target = [inner-tunnel]:51280

inner.conf:

[Peer]
Endpoint = 127.0.0.1:1234 # inner proxy
PublicKey = [inner-key]

@VastBlast
Copy link
Author

Love the DNS use-case. cc @whyvl

Just a thought: would this enable nested wireguard tunnels with two wireproxy daemons? e.g.

outer.conf:

[Peer]
Endpoint = [outer-tunnel]:51280
PublicKey = [outer-key]

[UDPProxyTunnel]
BindAddress = 127.0.0.1:1234
Target = [inner-tunnel]:51280

inner.conf:

[Peer]
Endpoint = 127.0.0.1:1234 # inner proxy
PublicKey = [inner-key]

Yes, it would. Might need more testing, but it should.

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

Successfully merging this pull request may close these issues.

2 participants