I’m trying to setup up a TeamSpeak3 server on my home network "net1.mydomain". It uses an IPv4 subnet of 10.0.0.0/8 in LAN; internet access using IPv4 is possible via CGN. This renders IPv4-only-listeners (as is TeamSpeak) unreachable for clients outside of "net1.mydomain".
To circumvent this only downside, I found socat
(SOcket CAT; multipurpose relay.) helpful, as I also have access to a machine fwbox.net2.mydomain
which has a full IPv4 and IPv6 dual-stack connection.
Let the server run on machine tsbox.net1.mydomain
, ports 1234/UDP4
(voice), 1234/TCP4
(query), 1235/TCP
(file). After running following commandset I can use the TS3-client to connect to fwbox.net2.mydomain:1234
as if my TS3-server was running there instead.
ldericher@fwbox$ socat TCP4-LISTEN:1234,fork TCP6:tsbox.net1.mydomain:61234 &# queryport
ldericher@fwbox$ socat TCP4-LISTEN:1235,fork TCP6:tsbox.net1.mydomain:61235 &# fileport
ldericher@fwbox$ socat UDP4-LISTEN:1234,fork TCP6:tsbox.net1.mydomain:61236 &# voiceport
ldericher@tsbox$ socat TCP6-LISTEN:61234,fork TCP4:localhost:1234 &# queryport
ldericher@tsbox$ socat TCP6-LISTEN:61235,fork TCP4:localhost:1235 &# fileport
ldericher@tsbox$ socat TCP6-LISTEN:61236,fork UDP4:localhost:1234 &# voiceport
Well, almost.
Due to FIFO-fication of the voice (UDP-)stream, a high percentage of packages gets dropped and the connection is unusable. So ideally, it would just pass on UDP-packets via IPv6 - but using the following commands instead just produces "Permission denied" on tsbox
…
ldericher@fwbox$ socat UDP4-LISTEN:1234,reuseaddr,fork UDP6:tsbox.net1.mydomain:61234 &# voiceport
ldericher@tsbox$ socat UDP6-LISTEN:61234,reuseaddr,fork UDP4:localhost:1234 &# voiceport
…for which I blame the connectionless nature of UDP. I tried tinkering with the options of socat
, to no avail. "UDP-RECVFROM"/"UDP-SENDTO" does not produce errors, yet only seems to to unidirectional forwarding. I read about stone
(application TCP/IP repeater) being out there, which might serve as an alternative, yet did not come in handier than socat
for me.
Either I completely missed some point about UDP, or it’s just not possible to do UDP forwarding at all, or it’s my toolset.
So is there any way, any tool or any snippet of code which may suit my needs? Maybe even a set of socat
options I've not yet come up with?
ADD 03/06/2015
It is possible to forward UDP traffic as I want. Even using socat, there is a way. I successfully tested that using another box, testbox.net1.mydomain
:
# File- and Query- portforwards omitted for irrelevance
ldericher@testbox$ socat UDP4-LISTEN:1234,fork UDP4:tsbox:61234 &
ldericher@tsbox$ socat UDP4-LISTEN:61234,fork UDP4:localhost:1234 &
This works without any performance loss, yet it doesn't solve my problem of not being able to use IPv4 from outside.
# File- and Query- portforwards omitted for irrelevance
ldericher@testbox$ socat UDP4-LISTEN:1234,fork UDP6:tsbox:61234 &
ldericher@tsbox$ socat UDP6-LISTEN:61234,fork UDP4:localhost:1234 &
This does not work in the same way as forwarding across fwbox
.
So, am I just missing an important point about IPv6?
Is this a bug? In socat? In Linux?!