# Discord Voice Servers Routing via tun2socks on macOS This guide explains how to route all Discord voice server traffic through `tun2socks` using a list of IP addresses from [discord-voice-ips](https://github.com/GhostRooter0953/discord-voice-ips). --- ## Prerequisites - macOS - `jq` installed (`brew install jq` if needed) - `tun2socks` installed from [xjasonlyu/tun2socks](https://github.com/xjasonlyu/tun2socks) --- ## Setup `tun2socks` ```bash tun2socks -device utun123 -proxy socks5://127.0.0.1:7897 sudo ifconfig utun123 198.18.0.1 198.18.0.1 up ```` > The IP `198.18.0.1` will be used as the gateway for routing Discord traffic. --- ## Download and Prepare Discord IPs ```bash git clone https://github.com/GhostRooter0953/discord-voice-ips.git cd discord-voice-ips/amnezia jq -s 'add | unique_by(.ip)' amnezia-*.json > merged.json ``` --- ## Manage Routes with `gen_routes.sh` > Make sure the script is executable: ```bash chmod +x gen_routes.sh ``` --- ## Quick Command Table | Step | Command | Description | | -------------- | ----------------------------------- | ------------------------------------------------------------------------------------ | | Preview routes | `./gen_routes.sh merged.json` | Shows which routes will be applied | | Apply routes | `./gen_routes.sh apply merged.json` | Adds all Discord voice server IPs via `tun2socks` gateway | | Delete routes | `./gen_routes.sh delete 198.18.0.1` | Removes all routes pointing to the `tun2socks` gateway, skipping destination=gateway | --- ## Notes * The `merged.json` file contains all Discord voice server IPs with duplicates removed. * Update the JSON files periodically to keep routing current. * Verify routes with `netstat -rn` before deleting or modifying them.