Main WireGuard configuration for wireproxy:
[Interface]
# Your Mullvad private key (from downloaded config)
PrivateKey = YOUR_MULLVAD_PRIVATE_KEY
# Assigned WireGuard IP
Address = 10.68.41.179/32
# Mullvad DNS
DNS = 100.64.0.7
[Peer]
# Mullvad server public key
PublicKey = ItEcyDXwTXtq6bQubbO6lY0K/oh0dfk26AV+muU+Ah4=
# Points to local udp2tcp tunnel (NOT direct to Mullvad)
Endpoint = 127.0.0.1:51822
# Route all traffic through VPN
AllowedIPs = 0.0.0.0/0
# Keep connection alive through NAT
PersistentKeepalive = 25
[Socks5]
# SOCKS5 proxy for applications
BindAddress = 0.0.0.0:1081
[http]
# HTTP proxy for applications
BindAddress = 0.0.0.0:8081- PrivateKey must match Mullvad registration: Use the key from your downloaded Mullvad config, not a self-generated one
- Endpoint is localhost: Because udp2tcp handles the actual connection
- Ports 1081/8081: Port 1080 is often used by other services
- Log into Mullvad account
- Download WireGuard config for desired server
- The
PrivateKeyin that config is your registered key - The peer's
PublicKeyand server IP are what you need
base {
log_debug = off;
log_info = on;
daemon = on;
redirector = iptables;
}
redsocks {
local_ip = 0.0.0.0;
local_port = 12345;
ip = 127.0.0.1;
port = 1081;
type = socks5;
}# Create chain for redsocks
iptables -t nat -N REDSOCKS
# Skip local/private addresses
iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
iptables -t nat -A REDSOCKS -d 192.168.0.0/16 -j RETURN
iptables -t nat -A REDSOCKS -d 224.0.0.0/4 -j RETURN
iptables -t nat -A REDSOCKS -d 240.0.0.0/4 -j RETURN
# Redirect TCP to redsocks
iptables -t nat -A REDSOCKS -p tcp -j REDIRECT --to-ports 12345
# Apply to traffic from LAN
iptables -t nat -A PREROUTING -i br0 -p tcp -j REDSOCKSThe router uses connmand for network management. DNS is set via:
# Check current DNS
cat /etc/resolv.conf
# DNS may be controlled by connman
# Configuration in /var/lib/connman/For split tunneling, you may want to use a DNS that returns correct IPs for Chinese services while using Mullvad DNS for foreign sites.