# /etc/systemd/system/ssh-tunnel.service
[Unit]
Description=Persistent SSH port-forward tunnel
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=YOUR_USER
ExecStart=/usr/bin/ssh \
-NT \
-L 127.0.0.1:22:127.0.0.1:22100 \
-o ServerAliveInterval=30 \
-o ServerAliveCountMax=3 \
-o ExitOnForwardFailure=yes \
user@SSH_HOST
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target