Multiple NICs and PING

If I have 2 NIC's defined ....

Can I force a ping to go specifically through one of the NIC's

If so , how would I do that
Los Angeles1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you talking on a Microsoft PC/server, router, firewall?

If it's a MS device and have multiple NICs in different subnets only one of them can have a default gateway so that would be determine the flow of traffic.  You could possibly create a static route in the routing table to force it down the subnet that doesn't have a default gateway assigned but I've never tried.  It seems like it would work, in theory.
If the NIC's IP addresses are in different subnets then ping to a machine in one of those subnets will go through the appropriate interface (the one being in the same subnet as the target).

With NICs in the same subnet it's not really possible. You can use the "-S source_ip"
flag of ping to make the ICMP packets look as if they came from that IP (source_ip must be one of the machine's addresses), but it's not guaranteed that the packets will indeed be sent from that specific NIC.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.