diff --git a/service/model/iptables/redirect.go b/service/model/iptables/redirect.go index defafa69..9f781af6 100644 --- a/service/model/iptables/redirect.go +++ b/service/model/iptables/redirect.go @@ -33,7 +33,7 @@ iptables -t nat -A V2RAY -p tcp -j REDIRECT --to-ports 12345 iptables -t nat -A PREROUTING -p tcp -j V2RAY iptables -t nat -A OUTPUT -p tcp -j V2RAY ` - if cmds.IsCommandValid("ip6tables") { + if cmds.IsCommandValid("sysctl") { commands += ` #禁用ipv6 sysctl -w net.ipv6.conf.all.disable_ipv6=1 @@ -52,7 +52,7 @@ iptables -t nat -D OUTPUT -p tcp -j V2RAY iptables -t nat -D OUTPUT -p udp -j V2RAY iptables -t nat -X V2RAY ` - if cmds.IsCommandValid("ip6tables") { + if cmds.IsCommandValid("sysctl") { commands += ` sysctl -w net.ipv6.conf.all.disable_ipv6=0 sysctl -w net.ipv6.conf.default.disable_ipv6=0 diff --git a/service/model/iptables/tproxy.go b/service/model/iptables/tproxy.go index d0d76ae3..4667257a 100644 --- a/service/model/iptables/tproxy.go +++ b/service/model/iptables/tproxy.go @@ -60,7 +60,7 @@ iptables -t mangle -A SSTP_PRE -p udp -m mark ! --mark 1 -j SETMARK iptables -t mangle -A SSTP_PRE -m mark --mark 1 -p tcp -j TPROXY --on-port 12345 iptables -t mangle -A SSTP_PRE -m mark --mark 1 -p udp -j TPROXY --on-port 12345 ` - if cmds.IsCommandValid("ip6tables") { + if cmds.IsCommandValid("sysctl") { commands += ` #禁用ipv6 sysctl -w net.ipv6.conf.all.disable_ipv6=1 @@ -84,7 +84,7 @@ iptables -t mangle -X SSTP_PRE iptables -t mangle -F SETMARK iptables -t mangle -X SETMARK ` - if cmds.IsCommandValid("ip6tables") { + if cmds.IsCommandValid("sysctl") { commands += ` sysctl -w net.ipv6.conf.all.disable_ipv6=0 sysctl -w net.ipv6.conf.default.disable_ipv6=0 diff --git a/service/model/v2ray/v2rayTmpl.go b/service/model/v2ray/v2rayTmpl.go index 04a4640f..e1b0e48d 100644 --- a/service/model/v2ray/v2rayTmpl.go +++ b/service/model/v2ray/v2rayTmpl.go @@ -741,9 +741,9 @@ func (t *Template) SetOutboundSockopt(supportUDP bool) { if t.Outbounds[i].StreamSettings.Sockopt == nil { t.Outbounds[i].StreamSettings.Sockopt = new(Sockopt) } - //if t.Outbounds[i].Protocol == "freedom" { - // t.Outbounds[i].Settings.DomainStrategy = "UseIP" - //} + if t.Outbounds[i].Protocol == "freedom" { + t.Outbounds[i].Settings.DomainStrategy = "UseIP" + } t.Outbounds[i].StreamSettings.Sockopt.Mark = &mark t.Outbounds[i].StreamSettings.Sockopt.Tos = &tos // Experimental in the future }