How to send UDP packets from a public host to a private host behind NAT, with no port forwarding.
https://github.com/prof7bit/udp-reverse-tunnel
- Install with a parameter instead of a fixed port
sudo make install-outside listen=%i
- Rename
cd /etc/systemd/system
mv udp-tunnel-outside.service [email protected]
- Edit the
[email protected]
file to work with a parameter
[Unit]
Description=reverse UDP tunnel (outside agent) on port %i
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
Restart=always
RestartSec=60
ExecStart=udp-tunnel -l %i
[Install]
WantedBy=multi-user.target
- Enable it and start passing the ports as a parameter
sudo systemctl enable udp-tunnel-outside@{5001..5004}
sudo systemctl daemon-reload
sudo systemctl start udp-tunnel-outside@{5001..5004}
- Check status
systemctl status udp-tunnel-outside@{5001..5004}