SagerNet / SagerNet/sing-tun

Read IP address from exists tun+ interface

Open
#58 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
237
Forks
228
PR merge metrics
No merged PRs in 30d

Description

Some routers have an additional interface for tunnel configuration TUN.
Add the ability to read IP addresses from an existing TUN adapter.

sing-box config

  "inbounds": [
    {
      "type": "tun",
      "interface_name": "opkgtun0",
      "domain_strategy": "ipv4_only",
      "auto_route": false,
      "strict_route": false,
      "sniff": true
   }
  ]

ifconfig opkgtun0

opkgtun0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:172.16.0.2  P-t-P:172.16.0.2  Mask:255.255.255.255
          inet6 addr: fadd:4700:110:::2/128 Scope:Global
          POINTOPOINT NOARP MULTICAST  MTU:65535  Metric:1
          RX packets:219 errors:0 dropped:0 overruns:0 frame:0
          TX packets:254 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:150

Now

 ~  # sing-box run --config /tmp/1.json --directory /tmp
INFO[0000] network: updated default interface eth3, index 7
TRACE[0000] inbound/tun[0]: creating stack
FATAL[0000] start service: start inbound/tun[0]: missing interface address

Contributor guide

No contributing guide indexed for this repository

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 at the TUN inbound startup path that produces the “missing interface address” error, then trace how addresses are discovered for an existing interface. Reproduce with the provided sing-box configuration and opkgtun0 setup; done means the existing TUN adapter’s IPv4 and IPv6 addresses are read without the startup failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.