I have a working wireless connection to an access point with an internet connection (where my IP is 172.17.30.137). Over this wireless connection I am able to ping internet addresses (e.g. 4.2.2.1) as well as other machines on the wifi network (e.g. 172.17.30.1). I leave those ping processes running in the background. Now I plug in an ethernet cable, which goes to a LAN on which there is a DHCP server but no internet access. That DHCP server assigns my ethernet adapter an IP (10.35.1.100) and I am now also able to ping addresses on that LAN (e.g. 10.35.1.1). All three pings run concurrently for a few seconds to a few minutes, when suddenly the ping to 4.2.2.1 does this:
64 bytes from 4.2.2.1: icmp_seq=1629 ttl=55 time=8.376 ms64 bytes from 4.2.2.1: icmp_seq=1630 ttl=55 time=14.247 ms64 bytes from 4.2.2.1: icmp_seq=1631 ttl=55 time=18.024 msRequest timeout for icmp_seq 1632Request timeout for icmp_seq 1633Request timeout for icmp_seq 1634ping: sendto: No route to hostRequest timeout for icmp_seq 1635ping: sendto: No route to host
It stays that way, with me having no internet access, until I unplug the ethernet cable. While this is going on I still have access to 172.17.30.x and 10.35.1.x. When I unplug the ethernet cable the ping to 10.35.1.1 starts timing out and the ping to 4.2.2.1 starts working again within a couple of seconds.
What causes this? How can I fix it? Would it be helpful if I include copies of my routing table at various points in the process? How do I get that?