Skip to content

Instantly share code, notes, and snippets.

@hugojosefson
Forked from gartnera/tcp-forward.service
Last active January 30, 2021 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugojosefson/cf0d74894ca16bb8fa96dfc8132b0675 to your computer and use it in GitHub Desktop.
Save hugojosefson/cf0d74894ca16bb8fa96dfc8132b0675 to your computer and use it in GitHub Desktop.
systemd service to forward traffic from a port, to a different machine's (other) port
[Unit]
Description=Forward TCP from 9999 to 8888 on 10.77.77.77
After=network.target
[Service]
Type=simple
User=nobody
Group=nobody
ExecStart=/usr/bin/socat TCP-LISTEN:9999,fork TCP:10.77.77.77:8888
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment