Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invitation-generated tinc-up tries to set address/route before bringing up interface #452

Open
genpfault opened this issue Mar 21, 2024 · 0 comments
Assignees
Labels
1.1 Issue related to Tinc 1.1 bug Issues in which the users gave a clear indication to the causes of the unexpected behaviour linux Issues specific to Linux. solution_exists A solution for the issue has already been suggested in the discussion.

Comments

@genpfault
Copy link

Trying to join an invitation URL on a Linux host results in this sort of tinc-up script:

Please review the following tinc-up script:

#!/bin/sh
ip addr replace 172.16.1.3 dev "$INTERFACE"
ip route add 172.16.1.0/24 dev "$INTERFACE"
ip link set "$INTERFACE" up

Do you want to use this script [y]es/[n]o/[e]dit?

Unfortunately adding addresses/routes before bringing up the interface doesn't work:

$ journalctl -u [email protected] --follow
Mar 20 12:22:01 newnode systemd[1]: Started [email protected] - Tinc net netname.
Mar 20 12:22:01 newnode tincd[12370]: tincd 1.1~pre18 (Jun 27 2021 18:10:22) starting, debug level 0
Mar 20 12:22:01 newnode tincd[12370]: /dev/net/tun is a Linux tun/tap device (tun mode)
Mar 20 12:22:01 newnode tincd[12375]: Error: Device for nexthop is not up.
Mar 20 12:22:01 newnode tincd[12370]: Ready

Putting the interface bring-up first:

#!/bin/sh
ip link set "$INTERFACE" up
ip addr replace 172.16.1.3 dev "$INTERFACE"
ip route add 172.16.1.0/24 dev "$INTERFACE"

...fixes it:

$ journalctl -u [email protected] --follow
Mar 20 12:25:27 newnode systemd[1]: Started [email protected] - Tinc net netname.
Mar 20 12:25:27 newnode tincd[12621]: tincd 1.1~pre18 (Jun 27 2021 18:10:22) starting, debug level 0
Mar 20 12:25:27 newnode tincd[12621]: /dev/net/tun is a Linux tun/tap device (tun mode)
Mar 20 12:25:27 newnode tincd[12621]: Ready

Dug up a SuperUser question/answer going over the differences between the old ifconfig command and the newer iproute2 stuff.

System information:

  • OS: amd64 Debian 12/Bookworm

  • Tinc built/installed via the Debian experimental package:

    dget https://deb.debian.org/debian/pool/main/t/tinc/tinc_1.1~pre18-1.dsc
    cd tinc-1.1~pre18/
    debuild -b -uc -us
    cd ..
    sudo mkdir -p /etc/tinc
    sudo dpkg -i tinc_1.1~pre18-1_amd64.deb
    
@gsliepen gsliepen added solution_exists A solution for the issue has already been suggested in the discussion. 1.1 Issue related to Tinc 1.1 linux Issues specific to Linux. labels Mar 23, 2024
@gsliepen gsliepen self-assigned this Mar 23, 2024
@gsliepen gsliepen added the bug Issues in which the users gave a clear indication to the causes of the unexpected behaviour label Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.1 Issue related to Tinc 1.1 bug Issues in which the users gave a clear indication to the causes of the unexpected behaviour linux Issues specific to Linux. solution_exists A solution for the issue has already been suggested in the discussion.
Projects
None yet
Development

No branches or pull requests

2 participants