title: Finding routing interface in Erlang
body: <p>I have a machine with multiple network interfaces each of which connects to a different network. I want to, from an Erlang application, find which interface will be used to connect to a given host.</p>
  
  <p>For example I have a machine with interfaces, eth0 and eth1. eth0 is on a 10.x.x.x network, eth1 is on a 192.168.0.x network. I want a function that give the ip address 10.0.1.2 will tell me eth0 and given the ip address 192.168.0.74 will tell me eth1.</p>