Coder Social home page Coder Social logo

Comments (4)

Herts avatar Herts commented on June 26, 2024

参考了这个:https://gitee.com/felix-fly/v2ray-dnsmasq-dnscrypt
该项目的cn.conf要用ipset读取, 在iptables中直接绕过。

我根据该项目的思路进行改写:
/etc/init.d/v2ray

        # ToutyRater/v2ray-guide#24
        ipset -R < /etc/v2ray/cn.conf # load the cn.conf
        iptables-restore --noflush <<-EOF 2>/dev/null
                *nat
                :V2RAY -                                
                $(for s in $server_ips ; do echo "-A V2RAY -d $s -j RETURN" ; done)
                $(for r in $reserved_ips ; do echo "-A V2RAY -d $r -j RETURN" ; done)
                -A V2RAY -m set --match-set cn dst -j RETURN # return the traffic directly            
                -A V2RAY -p tcp -j REDIRECT --to-ports $port
                -A PREROUTING -p tcp -j V2RAY
                #-A OUTPUT -p tcp -j V2RAY 
                COMMIT              
        EOF

cn.conf

create cn hash:net family inet hashsize 1024 maxelem 65536
add cn 1.0.1.0/24
add cn 1.0.2.0/23
...
add cn 223.255.252.0/23

据此可以再添加一个custom.conf,用同样的方法直接避开v2ray。

from luci-app-v2ray.

Herts avatar Herts commented on June 26, 2024

目前自己fork了一个版本加入了这个功能,但是还有待完善:

  1. ipset成为项目依赖包
  2. 无GUI界面
  3. UDP转发未做相应处理。

不过明显改善当前ssh断联的情况。

from luci-app-v2ray.

kuoruan avatar kuoruan commented on June 26, 2024

服务重启的时候会将所有包含 V2RAY 的规则给清除掉,所以你指定一个不含 V2RAY 的表名就行了

iptables-save --counters | grep -v "V2RAY" | iptables-restore --counters

from luci-app-v2ray.

Herts avatar Herts commented on June 26, 2024

服务重启的时候会将所有包含 V2RAY 的规则给清除掉,所以你指定一个不含 V2RAY 的表名就行了

iptables-save --counters | grep -v "V2RAY" | iptables-restore --counters

是我想在luci中的firewall中配置规则,然后这里的规则重启防火墙才能生效,但也会导致目前正在运行的V2RAY规则被清空。

from luci-app-v2ray.

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.