I have two gateways in my subnet. 192.168.1.2 - main 192.168.1.1 - secondary (yeah that's not a mistake)
So I am using 192.168.1.2 everywhere as default route
Is it possible to configure danted so it will forward outgoing connections to the secondary gateway (192.168.1.1) while main system will use main gateway? Or should I do some tweaking with iptables to achieve that?
Other possible solution is to do an lxc container with different network stack, but I am trying to achieve same goal on rpi with not much RAM and without that kind of redundant solutions.
So I wonder if it supports that out of the box, or maybe I can split network stack without any virtualization? (create virtual interface with other gateway maybe and then pass that secondary interface to danted)
Thanks
So my main gateway on that machine is 192.168.1.2. I wan't to redirect all traffic from specific user through another gateway 192.168.1.1
Creating new user that will be redirected to another gateway
Adding new routing table
adding ip rule so all marked packets will go to new routing table
marking all packets from user proxy (and allowing our subnet to communicate without any redirection)
This way user proxy will use separate routing table
now all ip traffic works fine, but dns don't work
DNS requests don't work because it tries to use 127.0.0.1:53 which is routed through main gateway
now redirecting also dns traffic to same gateway, not letting it touch 127.0.0.1:53
You can also put 8.8.8.8 there and it will be passed through 192.168.1.1, the main idea is to get it away from local caching dns server
now dns requests routed fine, you can check that with sniffer, however dig still shows dns from default gateway
making danted (or any other app) to use that rules by making it run as proxy user in dated.conf
and now you can add ip rule, ip route and iptables lines to rc.local and point your browser to danted socks server. All outbound traffic will be routed to 192.168.1.1 gateway