Skip to content

Instantly share code, notes, and snippets.

@nomaster
Created April 4, 2020 10:53
Show Gist options
  • Save nomaster/89d29ef773dea480071b7ac38108e2b3 to your computer and use it in GitHub Desktop.
Save nomaster/89d29ef773dea480071b7ac38108e2b3 to your computer and use it in GitHub Desktop.
Use socat to translate TCP6 to TCP4
[Unit]
Description=socat
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/socat TCP6-LISTEN:%i,reuseaddr,fork,bind=[::] TCP4:127.0.0.1:%i
Restart=on-abort
[Install]
WantedBy=multi-user.target
@nomaster
Copy link
Author

nomaster commented Apr 4, 2020

start with port number, for example:

sudo systemctl start socat@80.service

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