openwrt / openwrt/packages

sing-box: Interface tun "permission denied"

Open
#21,408 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Maintainer: @brvphoenix
Environment: x86_64, OpenWrt SNAPSHOT r23293-98e6ea32a4

Description:

On /etc/config/sing-box on default specify sing-box user. But if use tun mode:

Mon Jun 19 14:13:01 2023 daemon.err sing-box[3376]: FATAL[0000] start service: initialize inbound/tun[0]: configure tun interface: permission denied

/dev/net/tun must be managed with root privileges.

My inbounds, for example:

  "inbounds": [
    {
      "type": "tun",
      "interface_name": "tun0",
      "domain_strategy": "ipv4_only",
      "inet4_address": "172.19.0.1/30",
      "auto_route": false,
      "strict_route": false,
      "sniff": true 
   }
  ],

I think that in openwrt tun inbound will be the most frequently used. Perhaps you should change the default user to root.

Thanks for adding this package.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the default user setting in /etc/config/sing-box and the tun inbound requirements for /dev/net/tun on OpenWrt. Reproduce the provided permission-denied error with the sample tun configuration; done means the package's default configuration handles tun mode correctly without breaking the stated non-root setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
networking, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.