title: How does the OS know which network interface to use for the internet?
body: <p>I have a PC with two network interfaces: eth0 and eth1. </p>
  
  <p>eth0 - Has an ip of 192.168.11.X/24.</p>
  
  <p>eth1 - Has an ip of 192.168.130.X/24. eth1 has internet connectivity. </p>
  
  <p>How does my OS know which interface to use when I try connecting to the internet? Does it iterate over all default gateways? Does it have any cache of what each interface provides? Is there any difference in the behaivior between Windows and Linux?</p>