TCP Wireguard with socat
Gianluca Gabrielli
tuxmealux at protonmail.com
Mon Mar 12 10:15:52 CET 2018
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On March 9, 2018 10:45 PM, Matthias Urlichs <matthias at urlichs.de> wrote:
> On 09.03.2018 17:41, Gianluca Gabrielli wrote:
>
> > My first thought has been to make use of socat
>
> socat can do either packet streams or byte streams. A UDP socket (or a
>
> tun/tap interface) is a packet stream. TCP is a byte stream. You can't
>
> forward a packet stream into a byte stream. (Well, OK, socat does allow
>
> you to set that up, but it won't work.)
>
> You need wrap your packets in some sort of frame (simplest: precede each
>
> with a length word (but think about byte ordering)). I'm sure there are
>
> programs which do that, or you can write your own. socat can't do it.
Forwarding UDP packets (message oriented) into a TCP connection (stream oriented) could be done without any problem. Think about an OpenVPN TCP tunnel where you've redirected all your traffic, UDP connections as well.
Do you mean that socat just forward packets through the two specified channel without wrapping them?
More information about the WireGuard
mailing list