how to ping & use specific network card
ping
has a specific switch to set source interface: -I
. As found in the manpage:
-I interface address
Set source address to specified interface address. Argument may be numeric
IP address or name of device.
When pinging IPv6 link-local address this option is required.
As an example
$ ping -I wlan0 8.8.8.8
ping 8.8.8.8 through wlan0 interface.
Forcing an interface for a specific application needs some more work. You can find a solution in this superuser.com question and in this article linked in the answer.
UPDATE
The methods i exposed in this answer show how to force ping to use a specific interface. And links to some articles on how to force a generic program to use a specific interface.
Now, for all this to work, you have to configure some "advanced" routing. As you can see from the output of route -n
you have multiple networks, but only ONE gateway to the Internet. That is good, as multiple gateway routing is quite an advanced topic and somewhat difficult to handle well.
This goes beyond what you asked in the original question. I suggest you to post a new question here or on Server Fault asking how to configure and manage multiple internet gateways on multiple network interfaces.
Or, better yet, try googling it ;) Also check the LARTC site for advanced linux routing configurations.