Using DNS in iproute2
- by Oliver
In my setup I can redirect the default gateway based on the source address. Let's say a user is connected through tun0 (10.2.0.0/16) is redirect to another vpn. That works fine!
ip rule add from 10.2.0.10 lookup vpn1
In a second rule I redirect the default gateway to another gateway if the user access a certain ip adress:
ip rule add from 10.2.0.10 to 94.142.154.71 lookup vpn2
If I access the page on 94.142.154.71 (myip.is) the user is correctly routed and I can see the ip of the second vpn. On any other pages the ip address of vpn1 is shown.
But how do I tell iproute2 that all request at e. g. google.com should be redirected through vpn2?