Part of tor-i2p-openvpn configuration.
- .onion domains uses tor as proxy
- .i2p domains uses i2p as proxy
- Everything else uses vpn ip adress
For some reason, push dhcp-option dns not working, neither in Network Manager nor in openvpn cli. Workaround is to manually set nameserver 10.8.0.1 (where 10.8.0.1 is the openvpn's server tunnel adress) in /etc/resolv.conf
DNS server on 10.8.0.1 (vpn server) redirects .onion and .i2p domains to 10.8.0.1.
Following iptables rule on server routes all traffic from tunnel to tinyproxy on 8888:
iptables -t nat -I PREROUTING -i tun0 -p tcp --dport 80 -j REDIRECT --to-ports 8888
When client requests specific domain, it goes to TinyProxy, and then tinyproxy decides, what to do: send it to tor, i2p, or to use internet.