How to route only specific subnet (source ip) to a particular interface?
I know I can do easily by destination IP by using something like
route add 188.8.131.52/24 dev eth4
but I do not see how can route based on source IP.
You need to use policy based routing. Something kind of like
This pretty much says, that all traffic from
(can't test it ATM but i believe it's pretty much right :) )
This site has a nice example of source based routing.
You must use the route command. For example if you want to route all ip of 192.168.1.xxx to a particular device you have to use the following command:
With that command you say that all the packets sent from that subnet must be sent to the eth0 interface. If you need to add also a gateway for that connection you can use that: