Outils pour utilisateurs

Outils du site


tutos:adsb:scripts

Ceci est une ancienne révision du document !


Scripts pour alimentation ADSB

Prérequis: systemd, openvpn et socat

OpenVPN

/etc/systemd/system/openvpn-fremcom.service
[Unit]
Description=OpenVPN to FR-Emcom
After=network.target

[Service]
Type=simple
ExecStart=/usr/sbin/openvpn --config /etc/openvpn/client/fremcom.conf
WorkingDirectory=/root
Restart=always
#StartLimitIntervalSec=3
StartLimitBurst=0
RestartSec=3

[Install]
WantedBy=multi-user.target

Exemple de fichier de config OpenVPN:

client.cnf
remote vpn.example.org 1194
proto udp
ns-cert-type server
pull-filter ignore "redirect-gateway def1"
pull-filter ignore "redirect-gateway def1 bypass-dhcp"
route 192.168.100.0 255.255.255.0
route 192.168.200.0 255.255.255.0

client
dev tun
resolv-retry infinite
keepalive 10 120
nobind
comp-lzo
verb 3

user nobody
group nogroup

<ca>
 ------ 8<------------ SNIP!
</ca>

key-direction 1
<tls-auth>
 ------ 8<------------ SNIP!
</tls-auth>

<cert>
 ------ 8<------------ SNIP!
</cert>

<key>
 ------ 8<------------ SNIP!
</key>

Socat

/etc/systemd/system/socat-adsb-fremcom.service
[Unit]
Description=Socat ADSB to FR-Emcom
After=network.target

[Service]
Type=simple
ExecStart=/usr/sbin/socat -u TCP:127.0.0.1:30005 TCP:<target_ip>:<target_port>
WorkingDirectory=/etc/openvpn
Restart=always
#StartLimitIntervalSec=3
StartLimitBurst=0
RestartSec=3

[Install]
WantedBy=multi-user.target

Une fois le fichier enregistré, lancer les commandes suivantes:

systemctl daemon-reload
systemctl enable socat-adsb-fremcom
systemctl start socat-adsb-fremcom
tutos/adsb/scripts.1604586952.txt.gz · Dernière modification : 2020/11/05 14:35 de f4hof

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki