Ubuntu – Dante Socks5 allow access from ip range

dantesocksUbuntu

My 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
}

Question is, if my IP range from ISP starts with certain numbers, for example: 105.55.. how can i add that to config, so only from my ISP i could use SOCKS5 proxy?

Best Answer

Sorry to see no one have answered your question yet.

What you want to read up on is subnet.

If your ISP ip range is 105.55.xxx.xxx and you want to only allow ip range from 105.55.0.0 -> 105.55.255.255 you simple do this:

105.55.0.0/16

This means 8 bit match first octet and 8 bit match second octet(8+8=16).

This gives a client pass of:

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