-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Bug] docker inet4-route-address不起作用 #1128
Comments
@Victor2333 inet4 address只看fakeip-range,/30也是预期行为 |
@xishang0128 问题是fake ip的range也是16 |
说了,/30是预期行为 |
我说的不是Int4Address是路由表Inet4RouteAddress,也是预期行为? |
那你看路由表啊,你都没提供路由规则,而是一行log,这啥都看不出来 |
ip route |
@Victor2333 ip route show table 2022 请 |
/ # ip route show table 2022 |
ip rule 然后贴结果 |
/ # ip route show
default via 10.0.0.1 dev eth0
10.0.0.0/24 dev eth0 scope link src 10.0.0.247
10.2.0.0/30 dev Meta scope link src 10.2.0.0
/ # ip route show all
default via 10.0.0.1 dev eth0
10.0.0.0/24 dev eth0 scope link src 10.0.0.247
10.2.0.0/30 dev Meta scope link src 10.2.0.0
/ # ip rule
0: from all lookup local
9000: from all to 10.2.0.0/30 lookup 2022
9001: from all lookup unspec local
9002: from all lookup main suppress_prefixlength 0
9002: from all iif lo lookup 2022
9002: from 0.0.0.0 iif lo lookup 2022
9002: from 10.2.0.0/30 iif lo lookup 2022
9010: from all lookup unspec broadcast
32766: from all lookup main
32767: from all lookup default
/ # ip route show table 2022
ip: invalid argument '2022' to 'table'
/ # iptables
iptables v1.8.10 (nf_tables): no command specified
Try `iptables -h' or 'iptables --help' for more information.
/ # iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
/ # iptables -nvL -tmangle
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination |
docker compose meta:
container_name: meta
image: metacubex/mihomo:Alpha
restart: always
cap_add:
- ALL
devices:
- /dev/net/tun:/dev/net/tun
volumes:
- type: volume
source: meta-data
target: /root/.config/mihomo
networks:
pubvlan:
ipv4_address: 10.0.0.247 |
@Victor2333 尝试直接在真机环境运行,虚拟环境可能无法提供支持 |
好像找到原因了 |
我本地编译了一个table-index 199的版本 就好了 应该就是docker image不支持2022的问题 diff --git a/listener/sing_tun/server.go b/listener/sing_tun/server.go
index cc26d37d..fbd655b9 100644
--- a/listener/sing_tun/server.go
+++ b/listener/sing_tun/server.go
@@ -225,7 +225,7 @@ func New(options LC.Tun, tunnel C.Tunnel, additions ...inbound.Addition) (l *Lis
ExcludePackage: options.ExcludePackage,
FileDescriptor: options.FileDescriptor,
InterfaceMonitor: defaultInterfaceMonitor,
- TableIndex: 2022,
+ TableIndex: 199,
}
err = l.buildAndroidRules(&tunOptions) |
@Victor2333 过低的表id并不符合标准,pr也不会接受的 |
那使用1023或者做成可配置项呢? |
Verify steps
Mihomo version
Alpha
What OS are you seeing the problem on?
No response
Mihomo config
Mihomo log
Description
环境是ubuntu docker macvlan
配置了inet4-route-address不起作用
https://github.com/MetaCubeX/mihomo/blob/Meta/listener/sing_tun/server.go#L207
这行的值还是正确的是配置里的值
https://github.com/MetaCubeX/mihomo/blob/Meta/listener/sing_tun/server.go#L271
这行获取到的tunOption 里的Inet4RouteAddress值变成了10.2.0.0/30 而不是我原来配置的10.2.0.0/16
The text was updated successfully, but these errors were encountered: