Skip to content

为什么转发至tproxy时必须要打标记。 #287

@yueduz

Description

@yueduz
#代理局域网设备
nft add table v2ray
nft add chain v2ray prerouting { type filter hook prerouting priority 0 \; }
nft add rule v2ray prerouting ip daddr {127.0.0.1/32, 224.0.0.0/4, 255.255.255.255/32} return
nft add rule v2ray prerouting meta l4proto tcp ip daddr 192.168.0.0/16 return
nft add rule v2ray prerouting ip daddr 192.168.0.0/16 udp dport != 53 return
nft add rule v2ray prerouting mark 0xff return # 直连 0xff 流量
nft add rule v2ray prerouting meta l4proto {tcp, udp} mark set 1 tproxy to 127.0.0.1:12345 accept # 转发至 V2Ray 12345 端口

最后一行删除 “mark set 1"将无法代理局域网设备;
最后一行删除” tproxy to 127.0.0.1:12345“"也将无法代理局域网设备;
这是为什么。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingunconfirmedWaiting investigation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions