I have 3 interfaces on my server,
- first is used for the local network,
- second and third are internet connections (each has its own ip routing table).
How can i force server daemons and command line tools use first interface to create outgoing connections. I want use same iptables nat and filter rules for my server that i use for other machines of my network.
eth0 192.168.0.1
eth1 9.9.9.9
eth2 9.9.9.10
I don't know why it uses eth1 for outgoing connections now.
If you run
It will give you results similar to the following:
As you can see from the above output, any traffic which goes via the default route will go via eth0
So it sounds like you need to do something like this:
then
How you make this change permanent will depend on your distro.