Here you can find the source of getUsualNetworkInterfaces()
public static List<NetworkInterface> getUsualNetworkInterfaces()
//package com.java2s; /**//w w w . j a v a 2 s . c om * * @Title NetworkUtils.java * @Description ?AppStatus??????????????? * Copyright: Copyright (c) 2013, Opzoon and/or its affiliates. All rights reserved. * OPZOON PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * @author NY * @date 2013-11-30 ????11:02:07 * */ import java.net.NetworkInterface; import java.net.SocketException; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; public class Main { public static List<NetworkInterface> getUsualNetworkInterfaces() { List<NetworkInterface> resultList = new ArrayList<NetworkInterface>(); Enumeration<NetworkInterface> allNetInterfaces; try { allNetInterfaces = NetworkInterface.getNetworkInterfaces(); while (allNetInterfaces.hasMoreElements()) { NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement(); if (netInterface.isLoopback() || netInterface.isVirtual() || !netInterface.isUp()) { continue; } resultList.add(netInterface); } } catch (SocketException e) { System.out .println("Some error occured during execute method getServerUsualInterface, see details:" + e); } return resultList; } }