parent
7c55a472d5
commit
5cf6eeea48
@ -280,7 +280,6 @@ o = s:option(Value, "remote_dns_client_ip", translate("Remote DNS EDNS Client Su
|
|||||||
o.description = translate("Notify the DNS server when the DNS query is notified, the location of the client (cannot be a private IP address).") .. "<br />" ..
|
o.description = translate("Notify the DNS server when the DNS query is notified, the location of the client (cannot be a private IP address).") .. "<br />" ..
|
||||||
translate("This feature requires the DNS server to support the Edns Client Subnet (RFC7871).")
|
translate("This feature requires the DNS server to support the Edns Client Subnet (RFC7871).")
|
||||||
o.datatype = "ipaddr"
|
o.datatype = "ipaddr"
|
||||||
o:depends({ __hide = true })
|
|
||||||
|
|
||||||
o = s:option(ListValue, "remote_dns_detour", translate("Remote DNS Outbound"))
|
o = s:option(ListValue, "remote_dns_detour", translate("Remote DNS Outbound"))
|
||||||
o.default = "remote"
|
o.default = "remote"
|
||||||
@ -327,8 +326,6 @@ for k, v in pairs(nodes_table) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
s.fields["remote_dns_client_ip"]:depends({ _xray_node = "1", remote_dns_protocol = "tcp" })
|
|
||||||
s.fields["remote_dns_client_ip"]:depends({ _xray_node = "1", remote_dns_protocol = "doh" })
|
|
||||||
s.fields["dns_hosts"]:depends({ _xray_node = "1" })
|
s.fields["dns_hosts"]:depends({ _xray_node = "1" })
|
||||||
|
|
||||||
return m
|
return m
|
||||||
|
@ -305,7 +305,6 @@ o = s:taboption("DNS", Value, "remote_dns_client_ip", translate("Remote DNS EDNS
|
|||||||
o.description = translate("Notify the DNS server when the DNS query is notified, the location of the client (cannot be a private IP address).") .. "<br />" ..
|
o.description = translate("Notify the DNS server when the DNS query is notified, the location of the client (cannot be a private IP address).") .. "<br />" ..
|
||||||
translate("This feature requires the DNS server to support the Edns Client Subnet (RFC7871).")
|
translate("This feature requires the DNS server to support the Edns Client Subnet (RFC7871).")
|
||||||
o.datatype = "ipaddr"
|
o.datatype = "ipaddr"
|
||||||
o:depends({ __hide = true })
|
|
||||||
|
|
||||||
o = s:taboption("DNS", ListValue, "remote_dns_detour", translate("Remote DNS Outbound"))
|
o = s:taboption("DNS", ListValue, "remote_dns_detour", translate("Remote DNS Outbound"))
|
||||||
o.default = "remote"
|
o.default = "remote"
|
||||||
@ -352,8 +351,6 @@ o.template = "passwall2/cbi/hidevalue"
|
|||||||
o.value = "1"
|
o.value = "1"
|
||||||
o:depends({ __hide = true })
|
o:depends({ __hide = true })
|
||||||
|
|
||||||
s.fields["remote_dns_client_ip"]:depends({ _xray_node = "1", remote_dns_protocol = "tcp" })
|
|
||||||
s.fields["remote_dns_client_ip"]:depends({ _xray_node = "1", remote_dns_protocol = "doh" })
|
|
||||||
s.fields["dns_hosts"]:depends({ _xray_node = "1" })
|
s.fields["dns_hosts"]:depends({ _xray_node = "1" })
|
||||||
|
|
||||||
s:tab("log", translate("Log"))
|
s:tab("log", translate("Log"))
|
||||||
|
@ -764,6 +764,7 @@ function gen_config(var)
|
|||||||
local remote_dns_detour = var["-remote_dns_detour"]
|
local remote_dns_detour = var["-remote_dns_detour"]
|
||||||
local remote_dns_query_strategy = var["-remote_dns_query_strategy"]
|
local remote_dns_query_strategy = var["-remote_dns_query_strategy"]
|
||||||
local remote_dns_fake = var["-remote_dns_fake"]
|
local remote_dns_fake = var["-remote_dns_fake"]
|
||||||
|
local remote_dns_client_ip = var["-remote_dns_client_ip"]
|
||||||
local dns_cache = var["-dns_cache"]
|
local dns_cache = var["-dns_cache"]
|
||||||
local tags = var["-tags"]
|
local tags = var["-tags"]
|
||||||
|
|
||||||
@ -1255,6 +1256,7 @@ function gen_config(var)
|
|||||||
strategy = remote_strategy,
|
strategy = remote_strategy,
|
||||||
address_resolver = "direct",
|
address_resolver = "direct",
|
||||||
detour = COMMON.default_outbound_tag,
|
detour = COMMON.default_outbound_tag,
|
||||||
|
client_subnet = (remote_dns_client_ip and remote_dns_client_ip ~= "") and remote_dns_client_ip or nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
if remote_dns_detour == "direct" then
|
if remote_dns_detour == "direct" then
|
||||||
@ -1376,6 +1378,7 @@ function gen_config(var)
|
|||||||
}
|
}
|
||||||
fakedns_dns_rule.server = fakedns_tag
|
fakedns_dns_rule.server = fakedns_tag
|
||||||
fakedns_dns_rule.disable_cache = true
|
fakedns_dns_rule.disable_cache = true
|
||||||
|
fakedns_dns_rule.client_subnet = nil
|
||||||
table.insert(dns.rules, fakedns_dns_rule)
|
table.insert(dns.rules, fakedns_dns_rule)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1581,6 +1584,7 @@ function gen_dns_config(var)
|
|||||||
local remote_dns_doh_ip = var["-remote_dns_doh_ip"]
|
local remote_dns_doh_ip = var["-remote_dns_doh_ip"]
|
||||||
local remote_dns_doh_port = var["-remote_dns_doh_port"]
|
local remote_dns_doh_port = var["-remote_dns_doh_port"]
|
||||||
local remote_dns_detour = var["-remote_dns_detour"]
|
local remote_dns_detour = var["-remote_dns_detour"]
|
||||||
|
local remote_dns_client_ip = var["-remote_dns_client_ip"]
|
||||||
local remote_dns_outbound_socks_address = var["-remote_dns_outbound_socks_address"]
|
local remote_dns_outbound_socks_address = var["-remote_dns_outbound_socks_address"]
|
||||||
local remote_dns_outbound_socks_port = var["-remote_dns_outbound_socks_port"]
|
local remote_dns_outbound_socks_port = var["-remote_dns_outbound_socks_port"]
|
||||||
local dns_cache = var["-dns_cache"]
|
local dns_cache = var["-dns_cache"]
|
||||||
@ -1667,6 +1671,7 @@ function gen_dns_config(var)
|
|||||||
address_strategy = "prefer_ipv6",
|
address_strategy = "prefer_ipv6",
|
||||||
strategy = (dns_query_strategy and dns_query_strategy ~= "UseIP") and "ipv4_only" or "prefer_ipv6",
|
strategy = (dns_query_strategy and dns_query_strategy ~= "UseIP") and "ipv4_only" or "prefer_ipv6",
|
||||||
detour = out_tag,
|
detour = out_tag,
|
||||||
|
client_subnet = (remote_dns_client_ip and remote_dns_client_ip ~= "") and remote_dns_client_ip or nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
if direct_dns_udp_server then
|
if direct_dns_udp_server then
|
||||||
|
@ -1670,7 +1670,6 @@ end
|
|||||||
function gen_dns_config(var)
|
function gen_dns_config(var)
|
||||||
local dns_listen_port = var["-dns_listen_port"]
|
local dns_listen_port = var["-dns_listen_port"]
|
||||||
local dns_out_tag = var["-dns_out_tag"]
|
local dns_out_tag = var["-dns_out_tag"]
|
||||||
local dns_client_ip = var["-dns_client_ip"]
|
|
||||||
local direct_dns_udp_server = var["-direct_dns_udp_server"]
|
local direct_dns_udp_server = var["-direct_dns_udp_server"]
|
||||||
local direct_dns_udp_port = var["-direct_dns_udp_port"]
|
local direct_dns_udp_port = var["-direct_dns_udp_port"]
|
||||||
local direct_dns_tcp_server = var["-direct_dns_tcp_server"]
|
local direct_dns_tcp_server = var["-direct_dns_tcp_server"]
|
||||||
@ -1690,6 +1689,7 @@ function gen_dns_config(var)
|
|||||||
local remote_dns_doh_port = var["-remote_dns_doh_port"]
|
local remote_dns_doh_port = var["-remote_dns_doh_port"]
|
||||||
local remote_dns_query_strategy = var["-remote_dns_query_strategy"]
|
local remote_dns_query_strategy = var["-remote_dns_query_strategy"]
|
||||||
local remote_dns_detour = var["-remote_dns_detour"]
|
local remote_dns_detour = var["-remote_dns_detour"]
|
||||||
|
local remote_dns_client_ip = var["-remote_dns_client_ip"]
|
||||||
local remote_dns_outbound_socks_address = var["-remote_dns_outbound_socks_address"]
|
local remote_dns_outbound_socks_address = var["-remote_dns_outbound_socks_address"]
|
||||||
local remote_dns_outbound_socks_port = var["-remote_dns_outbound_socks_port"]
|
local remote_dns_outbound_socks_port = var["-remote_dns_outbound_socks_port"]
|
||||||
local dns_cache = var["-dns_cache"]
|
local dns_cache = var["-dns_cache"]
|
||||||
@ -1713,7 +1713,7 @@ function gen_dns_config(var)
|
|||||||
disableFallback = true,
|
disableFallback = true,
|
||||||
disableFallbackIfMatch = true,
|
disableFallbackIfMatch = true,
|
||||||
servers = {},
|
servers = {},
|
||||||
clientIp = (dns_client_ip and dns_client_ip ~= "") and dns_client_ip or nil,
|
clientIp = (remote_dns_client_ip and remote_dns_client_ip ~= "") and remote_dns_client_ip or nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
local other_type_dns_proto, other_type_dns_server, other_type_dns_port
|
local other_type_dns_proto, other_type_dns_server, other_type_dns_port
|
||||||
|
@ -422,7 +422,7 @@ run_xray() {
|
|||||||
esac
|
esac
|
||||||
[ -n "$remote_dns_detour" ] && DNS_REMOTE_ARGS="${DNS_REMOTE_ARGS} -remote_dns_detour ${remote_dns_detour}"
|
[ -n "$remote_dns_detour" ] && DNS_REMOTE_ARGS="${DNS_REMOTE_ARGS} -remote_dns_detour ${remote_dns_detour}"
|
||||||
[ -n "$remote_dns_query_strategy" ] && DNS_REMOTE_ARGS="${DNS_REMOTE_ARGS} -remote_dns_query_strategy ${remote_dns_query_strategy}"
|
[ -n "$remote_dns_query_strategy" ] && DNS_REMOTE_ARGS="${DNS_REMOTE_ARGS} -remote_dns_query_strategy ${remote_dns_query_strategy}"
|
||||||
[ -n "$remote_dns_client_ip" ] && DNS_REMOTE_ARGS="${DNS_REMOTE_ARGS} -dns_client_ip ${remote_dns_client_ip}"
|
[ -n "$remote_dns_client_ip" ] && DNS_REMOTE_ARGS="${DNS_REMOTE_ARGS} -remote_dns_client_ip ${remote_dns_client_ip}"
|
||||||
[ "$remote_fakedns" = "1" ] && _extra_param="${_extra_param} -remote_dns_fake 1 -remote_dns_fake_strategy ${remote_dns_query_strategy}"
|
[ "$remote_fakedns" = "1" ] && _extra_param="${_extra_param} -remote_dns_fake 1 -remote_dns_fake_strategy ${remote_dns_query_strategy}"
|
||||||
|
|
||||||
local independent_dns
|
local independent_dns
|
||||||
@ -449,7 +449,7 @@ run_xray() {
|
|||||||
|
|
||||||
run_singbox() {
|
run_singbox() {
|
||||||
local flag node redir_port socks_address socks_port socks_username socks_password http_address http_port http_username http_password
|
local flag node redir_port socks_address socks_port socks_username socks_password http_address http_port http_username http_password
|
||||||
local dns_listen_port direct_dns_query_strategy remote_dns_protocol remote_dns_udp_server remote_dns_tcp_server remote_dns_doh remote_dns_detour remote_fakedns remote_dns_query_strategy dns_cache write_ipset_direct
|
local dns_listen_port direct_dns_query_strategy remote_dns_protocol remote_dns_udp_server remote_dns_tcp_server remote_dns_doh remote_dns_client_ip remote_dns_detour remote_fakedns remote_dns_query_strategy dns_cache write_ipset_direct
|
||||||
local loglevel log_file config_file
|
local loglevel log_file config_file
|
||||||
local _extra_param=""
|
local _extra_param=""
|
||||||
eval_set_val $@
|
eval_set_val $@
|
||||||
@ -536,6 +536,7 @@ run_singbox() {
|
|||||||
|
|
||||||
[ -n "$remote_dns_detour" ] && _extra_param="${_extra_param} -remote_dns_detour ${remote_dns_detour}"
|
[ -n "$remote_dns_detour" ] && _extra_param="${_extra_param} -remote_dns_detour ${remote_dns_detour}"
|
||||||
[ -n "$remote_dns_query_strategy" ] && _extra_param="${_extra_param} -remote_dns_query_strategy ${remote_dns_query_strategy}"
|
[ -n "$remote_dns_query_strategy" ] && _extra_param="${_extra_param} -remote_dns_query_strategy ${remote_dns_query_strategy}"
|
||||||
|
[ -n "$remote_dns_client_ip" ] && _extra_param="${_extra_param} -remote_dns_client_ip ${remote_dns_client_ip}"
|
||||||
|
|
||||||
[ -n "$dns_listen_port" ] && _extra_param="${_extra_param} -dns_listen_port ${dns_listen_port}"
|
[ -n "$dns_listen_port" ] && _extra_param="${_extra_param} -dns_listen_port ${dns_listen_port}"
|
||||||
[ -n "$dns_cache" ] && _extra_param="${_extra_param} -dns_cache ${dns_cache}"
|
[ -n "$dns_cache" ] && _extra_param="${_extra_param} -dns_cache ${dns_cache}"
|
||||||
|
Loading…
Reference in New Issue
Block a user