Multiple NICs and PING

Posted on 2012-08-31
Last Modified: 2012-08-31
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
Question by:Los Angeles1
    LVL 10

    Expert Comment

    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.
    LVL 68

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
    FreeBSD on EC2 FreeBSD ( is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    This tutorial goes over how to archive and restore FreeBSD jails that are managed by ezjail.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now