gsliepen / tinc

a VPN daemon
http://tinc-vpn.org/
Other
1.95k stars 285 forks source link

Raspbian -systemd doesn't start tinc interface properly #168

Open kjansik opened 6 years ago

kjansik commented 6 years ago

Raspbian doesnt start tinc deamon on boot properly with Systemd:

tinc.service: [Unit] Description=Tinc VPN After=network.target

[Service] Type=oneshot RemainAfterExit=yes ExecStart=/bin/true ExecReload=/bin/true WorkingDirectory=/etc/tinc

[Install] WantedBy=multi-user.target

and tinc@.service: [Unit] Description=Tinc net %i PartOf=tinc.service ReloadPropagatedFrom=tinc.service

[Service] Type=simple WorkingDirectory=/etc/tinc/%i ExecStart=/usr/sbin/tincd -n %i -D -d3 --logfile ExecReload=/usr/sbin/tincd -n %i -kHUP TimeoutStopSec=5 Restart=always RestartSec=60

[Install] WantedBy=tinc.service

after boot is ifconfig status: mojtinc: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 inet6 fe80::a94d:42fc:d57c:ad7a prefixlen 64 scopeid 0x20 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500
after tinc restart: pi@raspberrypi:~ $ sudo systemctl restart tinc pi@raspberrypi:~ $ ifconfig

mojtinc: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 inet 192.168.1.5 netmask 255.255.0.0 destination 192.168.1.5 inet6 fe80::53ea:5266:7a5b:a660 prefixlen 64 scopeid 0x20 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500

I tried to change unit file: [Unit] Description=Tinc VPN Wants=network-online.target After=network-online.target

but without any success. Any idea?

kjansik commented 6 years ago

Workaround: ExecStartPre=/bin/sleep 30, helps little bit, but still problems: TINC interface is loosing IPV4 address silently after few hours: mojtinc: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 inet6 fe80::9d64:576d:ec60:4735 prefixlen 64 scopeid 0x20 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC) RX packets 434278 bytes 502381178 (479.1 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 340636 bytes 105683246 (100.7 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

kjansik commented 6 years ago

jessie with same configuration works like a charm..... stretch sucks.

gmacario commented 6 years ago

@kjansik I totally second your comments - I have tinc installed on two Raspberry Pi, the one on jessie works flawlessly while I am still debugging the one on stretch.

On the other hand Raspbian stretch packages tinc 1.0.31-1, while jessie is still at 1.0.24-2.1 - not sure if the problem is in the OS or in tinc...

Have you done any progress with tinc on Raspbian stretch since your last comments in mid January?

fangfufu commented 3 years ago

Does this bug still exist? I vaguely remember I seem to experienced similar thing whenever I start setting up tinc in new machine. I seem to occasionally end up deleting the systemd service file. I don't setup new tinc instances often, so I cannot confirm this bug personally right now.