This repository contains a helper script for installing and configuring a Dante SOCKS server on Debian/Ubuntu systems with an IP allow-list.
- A Debian or Ubuntu host with
aptpackage management. - Root privileges to install packages and modify
/etc/danted.conf.
To download the script straight from GitHub and run it:
curl -fsSL https://raw.githubusercontent.com/d3vw/fancy/main/setup_dante.sh -o setup_dante.sh
chmod +x setup_dante.sh
sudo ./setup_dante.sh -a 203.0.113.5 -a 198.51.100.0/24 -p 1090-a <ip_or_cidr>– Add one or more IP addresses or CIDR ranges (comma-separated) that are allowed to use the proxy. You can repeat the option.-r <ip_or_cidr>– Remove one or more IP addresses or CIDR ranges (comma-separated) from the allow-list. You can repeat the option.-p <port>– Port that the Dante server should listen on. Defaults to1080.-h– Show the built-in help text.
The script will:
- Install the
dante-serverpackage viaaptif it is not already installed. - Detect the default network interface used for outbound traffic.
- Back up any existing
/etc/danted.conffile with a timestamp suffix. - Write a new configuration that only allows the specified client networks and uses a passwordless SOCKS policy for those clients.
- Enable and restart the
dantedsystemd service.
After the script completes successfully, the Dante server will be listening on the requested port and only the IPs/CIDR blocks that remain after applying any -a and -r options will be permitted.