$ sudo redir :9875 192.168.1.101:78452
$ sudo vim /etc/systemd/system/redir.service [Unit] Description=Service redir pour la redirection de ports After=network-online.target Wants=network-online.target [Service] ExecStart=/usr/bin/redir -n -s :9875 192.168.1.101:78452 [Install] WantedBy=multi-user.target
On active le service et on vérifie :
$ sudo systemctl enable redir.service Created symlink /etc/systemd/system/multi-user.target.wants/redir.service → /etc/systemd/system/redir.service. $ netstat -nat Connexions Internet actives (serveurs et établies) Proto Recv-Q Send-Q Adresse locale Adresse distante Etat (...) tcp 0 0 0.0.0.0:9875 0.0.0.0:* LISTEN (...) $ sudo systemctl status redir-odroid.service ● redir-odroid.service - Service redir pour la redirection de ports vers l'Odroid Loaded: loaded (/etc/systemd/system/redir-odroid.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2018-12-20 14:38:12 CET; 3s ago Main PID: 1846 (redir) CGroup: /system.slice/redir-odroid.service └─1846 /usr/bin/redir -n -s 9875 192.168.1.101 78452 déc 20 14:38:12 raspberrypi systemd[1]: Started Service redir pour la redirection de ports