Giter Site home page Giter Site logo

Comments (5)

Andrei-Pozolotin avatar Andrei-Pozolotin commented on August 20, 2024 1

log shows apparent problem:

ioctl(3, TUNSETIFF, 0x7fffb3906320)     = -1 EPERM (Operation not permitted)
ioctl(3, _IOC(0, 0x54, 0xca, 0), 0x7fffb3906320) = -1 EBADFD (File descriptor in bad state)

and the workaround is

systemd-nspawn ... --capability=CAP_NET_ADMIN

which is also cofirmed by
https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

--capability=
   ... Also CAP_NET_ADMIN is retained if --private-network is specified. ...

then these requests remain:
A) can tinc work with less capabilities then CAP_NET_ADMIN?
B) please report Operation not permitted instead of File descriptor in bad state?

from tinc.

Andrei-Pozolotin avatar Andrei-Pozolotin commented on August 20, 2024

attached is log from

# strace tincd -D -d 3 -n mail &> tinc.log

tinc.log.zip

from tinc.

 avatar commented on August 20, 2024

A) CAP_NET_ADMIN is necessary to create a tun or tap device:
https://github.com/torvalds/linux/blob/master/Documentation/networking/tuntap.txt#L44
Other device types might work well without CAP_NET_ADMIN.

from tinc.

gsliepen avatar gsliepen commented on August 20, 2024

Tinc can work without CAP_NET_ADMIN. In fact, it can even be started as a non-root user, even with a tun device: one needs to set up a persistent tun device beforehand, and ensure the non-root user has permissions to use it. To do this, use the following command:

ip tuntap add dev $NETNAME mode tun user $USER

Where you have to fill in $NETNAME and $USER yourself of course. You also have to configure the tun/tap interface before you start tinc, since if it doesn't have CAP_NET_ADMIN, the tinc-up script will most likely fail too.

from tinc.

Andrei-Pozolotin avatar Andrei-Pozolotin commented on August 20, 2024

thank you

from tinc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.