V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
caobug
V2EX  ›  macOS

PF 端口重定向死循环

  •  
  •   caobug · Jun 6, 2021 · 2140 views
    This topic created in 1785 days ago, the information mentioned may be changed or developed.

    我已把所有连接转发到 Proxy 1080 端口处理,当 Proxy 访问白名单以外的网络时就会陷入死循环,其连接会再次重定向到 1080 端口。

    rdr pass on lo0 proto {tcp, udp} from any to !<direct_cidr> -> 127.0.0.1 port 1080
    pass out route-to lo0 proto {tcp, udp} from any to !<direct_cidr>
    

    对于 Linux,可以在 Proxy 中设置标记,并在 iptables 针对此 --mark 放行。

    setsockopt(fd, SOL_SOCKET, SO_MARK, &mark, sizeof(mark));
    

    可是 macOS 咋办,有大佬知道吗,求救啊~~~

    1 replies    2022-10-17 22:06:33 +08:00
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5746 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 07:10 · PVG 15:10 · LAX 00:10 · JFK 03:10
    ♥ Do have faith in what you're doing.