comzyh / clash

A rule-based tunnel in Go.
GNU General Public License v3.0
128 stars 34 forks source link

[Bug] inappropriate ioctl for device #14

Closed onlyJinx closed 2 years ago

onlyJinx commented 3 years ago

Verify steps

Clash version

release最新版(20210310)

What OS are you seeing the problem on?

Linux

Clash config

clash@debian:~$ cat config.yaml
mixed-port: 1080
allow-lan: true
external-controller: 127.0.0.1:9090
secret: ''
tun:
  enable: true
  device-url: dev://ctun
  device-url: fd://5
  dns-listen: 0.0.0.0:53
dns:
  enable: true
  listen: 0.0.0.0:53
  default-nameserver:
    - 114.114.114.114
    - 8.8.8.8
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16

  fake-ip-filter:
    - '*.lan'
    - localhost.ptlogin2.qq.com

  nameserver:
    - 114.114.114.114
    - 8.8.8.8
    - tls://dns.rubyfish.cn:853
    - https://1.1.1.1/dns-query

  fallback:
    - tcp://1.1.1.1
proxies:
...
proxy-groups:
...
rules:
- GEOIP,CN,DIRECT
- MATCH,Proxy

Clash log

clash@debian:~$ ./clash-linux-amd64 -d .
INFO[0000] Start initial compatible provider Proxy
ERRO[0000] Start Tun interface error: can't open tun: inappropriate ioctl for device
INFO[0000] Mixed(http+socks5) proxy listening at: :1080
INFO[0000] RESTful API listening at: 127.0.0.1:9090

Description

我对着教程 敲命令,启动clash时提示标题里的报错(运行的用户也是clash),可以麻烦帮我看看是哪一部出问题了吗?我的输入顺序如下

ip tuntap add mode tun user clash name ctun ifconfig ctun up route add -net 198.18.0.0/16 dev ctun

ipconfig运行结果如下

root@debian:~# ifconfig
ctun: flags=4241<UP,POINTOPOINT,NOARP,MULTICAST>  mtu 1500
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.131  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::20c:29ff:fe3f:b2ca  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:3f:b2:ca  txqueuelen 1000  (Ethernet)
        RX packets 32177  bytes 44616187 (42.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8313  bytes 608868 (594.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

路由表

root@debian:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.2.2     0.0.0.0         UG    0      0        0 ens33
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33
198.18.0.0      0.0.0.0         255.255.0.0     U     0      0        0 ctun
github-actions[bot] commented 3 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days