Dante Socks5 允许从 IP 范围访问

Dante Socks5 允许从 IP 范围访问

我的danted.conf:

logoutput: syslog /var/log/danted.log
user.privileged: root
user.unprivileged: nobody

# The listening network interface or address.
internal: ens3 port=1080

# The proxying network interface or address.
external: ens3

# socks-rules determine what is proxied through the external interface.
# The default of "none" permits anonymous access.
#socksmethod: username
socksmethod: none

# client-rules determine who can connect to the internal interface.
# The default of "none" permits anonymous access.
clientmethod: none

client pass {
    from: 0.0.0.0/0 to: 0.0.0.0/0
    log: connect disconnect error
}

socks pass {
    from: 0.0.0.0/0 to: 0.0.0.0/0
    log: connect disconnect error
}

问题是,如果我的 ISP 的 IP 范围以某些数字开头,例如:105.55。我如何将其添加到配置中,以便仅从我的 ISP 可以使用 SOCKS5 代理?

答案1

很遗憾,还没有人回答您的问题。

您想要阅读的是子网。

如果您的 ISP IP 范围是 105.55.xxx.xxx 并且您只想允许 IP 范围从 105.55.0.0 -> 105.55.255.255,您可以简单地执行以下操作:

105.55.0.0/16

这意味着 8 位匹配第一个八位字节并且 8 位匹配第二个八位字节(8 + 8 = 16)。

这给了客户端通行证:

client pass {
    from: 105.55.0.0/16 to: 0.0.0.0/0
    log: connect disconnect error
}

相关内容