mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 01:29:24 +08:00
modules.services.xray: default not as router
This commit is contained in:
@@ -19,6 +19,7 @@ inputs:
|
||||
extraInterfaces = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
|
||||
hosts = mkOption { type = types.attrsOf types.nonEmptyStr; default = {}; };
|
||||
};
|
||||
v2ray-forwarder.asRouter = mkOption { type = types.bool; default = false; };
|
||||
};}));
|
||||
default = null;
|
||||
};
|
||||
@@ -289,6 +290,9 @@ inputs:
|
||||
fib daddr type local ct state new counter ct mark set ct mark | 1 return
|
||||
ct mark & 1 == 1 counter return
|
||||
|
||||
# 如果不作为路由器使用,则可以返回那些没有被标记的流量
|
||||
${if client.v2ray-forwarder.asRouter then "" else "meta mark & 1 == 0 counter return"}
|
||||
|
||||
ip saddr @noproxy_src_net counter return
|
||||
ip daddr @noproxy_net counter return
|
||||
ip saddr != 172.16.0.0/12 ip daddr @xmu_net meta l4proto { tcp, udp } counter \
|
||||
|
||||
Reference in New Issue
Block a user