Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6939789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:40:03+00:00 2026-05-27T12:40:03+00:00

I am a little confused regarding the return values from NetworkInterface.getNetworkInterfaces(). I am trying

  • 0

I am a little confused regarding the return values from NetworkInterface.getNetworkInterfaces(). I am trying to filter through the list of NetworkInterface objects to figure out which are “real” (backed by actual hardware). The code looks like…

Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
while ( e.hasMoreElements() ) {
    NetworkInterface iface = (NetworkInterface) e.nextElement();
    if ( !iface.isLoopback() && !iface.isVirtual() ) {
        byte[] macAddress = iface.getHardwareAddress();
        String message = String.format(
            "%s %s parent: %s",
            iface.getName(),
            byteArrayToHexString( macAddress ),
            iface.getParent() );
        System.out.println( message );
    }
}

…and the output like…

vnic1 00 1C 42 00 00 09  parent: null
vnic0 00 1C 42 00 00 08  parent: null
en1 60 33 4B 20 C4 97  parent: null

I know that the “vnic1” and “vnic0” ones aren’t “real” (they got put there by Parallels to support a VM I sometimes run on this machine). Is there a way through NetworkInterface that I can detect the not “real” ones or are they effectively indistinguishable from their actual counterparts, like “en1”? I would hate to have to resort to becoming dependent upon name like “its real if its name is en0 or en1”. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:40:04+00:00Added an answer on May 27, 2026 at 12:40 pm

    You could look up the first half of the MAC, as it is the vendor code. The majority of vendors probably make physical or virtual (not both) devices.

    You won’t hit 100% of cases with this approach, but it might be “good enough” for your use.

    It also won’t help you if someone spoofs the MAC address.

    What are you trying to do here? If you explain your ultimate goal, maybe there is another approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a little confused about the rules regarding restricted pointers. Maybe someone out there
I'm a little confused regarding the left and right join operators. select * from
I'm a little confused as to why I've been told to return const foo
I'm a little confused here: I'm trying to reverse engineer the ASCII value 65.
I am a little confused right now regarding C++ reference semantics. Suppose I have
I'm learning C# and coming from a Java world, I was a little confused
I'm just getting started with rails and I'm a little confused reading through different
I'm a little confused after reading something in a textbook. Regarding the code: void
After reading many documents regarding CSRF, I'm still a little bit confused. So I
I am little confused with the applicability of reinterpret_cast vs static_cast . From what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.