Easy IPv4 to IPv6 proxy

Josip Tišljar Mataušić (9A3SFZ)

Published on: May 6, 2026

Yesterday, I was helping OE1RCI configure a HAMNET 6to4 tunnel.

Among other things, he hosts a gopher server. Since pygopherd does not support binding to a TCP6 socket, the following socat command turned out to be very useful:

socat TCP6-LISTEN:70,ipv6only=1,fork,su=nobody,reuseaddr TCP4:127.0.0.1:70

It proxies incoming TCP6 connections to a TCP4 socket, making any application that uses TCP available over IPv6, you just need to set the ports correctly.



A simple systemd service could look something like this:

nano /etc/systemd/system/gopher6.service

[Unit]
Wants=network-online.target
After=network.target network-online.target
Description=Makes IPv4-only application available over IPv6

[Service]
ExecStart=socat TCP6-LISTEN:70,ipv6only=1,fork,su=nobody,reuseaddr TCP4:127.0.0.1:70

[Install]
WantedBy=multi-user.target