Giter Club home page Giter Club logo

Comments (10)

5high avatar 5high commented on August 24, 2024 4

ip rule add fwmark 0x01/0x01 table 100
ip route add local 0.0.0.0/0 dev lo table 100
iptables -t mangle -N V2RAY
iptables -t mangle -I V2RAY -d 192.168.1.0/24 -j RETURN
iptables -t mangle -I V2RAY -d 127.0.0.1/32 -j RETURN
iptables -t mangle -A V2RAY -p udp -j TPROXY --on-port 12345 -s !192.168.1.10 --tproxy-mark 0x01/0x01
iptables -t mangle -A V2RAY -p tcp -j TPROXY --on-port 12345 -s !192.168.1.10 --tproxy-mark 0x01/0x01
iptables -t mangle -A PREROUTING -j V2RAY

改成上面这个样子端口映射就恢复正常了

from ss-tproxy.

zfl9 avatar zfl9 commented on August 24, 2024

试试把你本机(你应该是在网关上设置的规则吧)的 IP 添加到 V2RAY 自定义链中,放行它,即:

iptables -t mangle -I V2RAY -d $public_ipaddr -j RETURN

或者,把最后一条规则改一下:

iptables -t mangle -A PREROUTING -i $内网网卡 -j V2RAY

from ss-tproxy.

5high avatar 5high commented on August 24, 2024

测试了一下,还是不行,我主路由器192.168.1.1 (有公网IP) 映射 4000 端口到 192.168.1.10 (V2RAY 服务器)

from ss-tproxy.

zfl9 avatar zfl9 commented on August 24, 2024

那我也不知道,iptables 规则单靠说是很难调试得当的,必须自己会调试才行。

from ss-tproxy.

5high avatar 5high commented on August 24, 2024

ip route add local 0.0.0.0/0 dev lo table 100

是否可以通过这个形式排除掉某个目标地址

from ss-tproxy.

zfl9 avatar zfl9 commented on August 24, 2024

请参考 ip rule 的语法,ip rule help

from ss-tproxy.

zfl9 avatar zfl9 commented on August 24, 2024

忘了一点,将最后一条规则改为:

iptables -t mangle -A PREROUTING -i $内网网卡 ! -s 192.168.1.10/32 -j V2RAY

from ss-tproxy.

5high avatar 5high commented on August 24, 2024

测试了一下,还是不行,

从外网进入流量是有的,再从192.168.1.10 返回192.168.1.1 就没有流量了。

from ss-tproxy.

zfl9 avatar zfl9 commented on August 24, 2024

so...,我也无能为力。

from ss-tproxy.

5high avatar 5high commented on August 24, 2024

Anyway , 还是要感谢你。

from ss-tproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.