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?
woolmilkporcConnect With a Mentor Commented:
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.
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.
All Courses

From novice to tech pro — start learning today.