2011-05-10 6 views
2

NetworkInterface.getNetworkInterfaces() 을 사용하여 내 컴퓨터의 네트워크 인터페이스를 쿼리했습니다. 본질적으로 네트워크 인터페이스 카드를 찾으려고합니다. 이것들은 보통 eth0, eth1 등과 같은 것으로 불립니다.누구나 Java GetNetworkInterfaces가 Windows 7에서 많은 인터페이스를 반환하는 이유를 설명 할 수 있습니까?

그것은 XP에서 이기고 심지어는 리트 필터링으로도 잘 작동합니다.

Windows 7의 특정 구성에서 방금 발견 된 네트워크 어댑터 수가 많습니다. XP 및 Vista 이상. 나는 단지 하나 개의 카드 구성되어 있지만, 세 가지 다른 네트워크 인터페이스

  • 인텔 (R) 82567LM-3 기가비트 네트워크 연결
  • 인텔 (R) 82567LM-3 기가비트 네트워크 연결 - QoS 패킷 스케줄러-0000
  • 을 얻을 수가
  • 인텔 (R) 82567LM-3 기가비트 네트워크 연결 - WFP 경량 필터-0000

이유는 본질적으로 같은 일을위한 3 가지 포인트.

또한 WAN MINIPORT라는 항목에 대해 여섯 개의 항목이 있습니다. (출력은 아래를 참조하십시오.)

필자는 이들을 걸러 낼 수는 있지만 물론 많은 쓰레기를 처리하는 데 성능 비용이 있습니다. 누구든지 왜 이러한 항목이 만들어지고 최소화하는 방법을 알고 있습니까? 내 시스템에 예를 들어

나는이 창에

import java.net.InetAddress; 
import java.net.NetworkInterface; 
import java.net.SocketException; 
import java.util.Arrays; 
import java.util.Collections; 
import java.util.Enumeration; 

import static java.lang.System.out; 


public class ListNetsEx { 

    /** 
    * @param args 
    */ 
    public static void main(String[] args) { 
     // TODO Auto-generated method stub 
     Enumeration<NetworkInterface> nets; 
     try { 
      nets = NetworkInterface.getNetworkInterfaces(); 
      for (NetworkInterface netint : Collections.list(nets)) 
       displayInterfaceInformation(netint); 
     } catch (SocketException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } 

    } 

    private static void displayInterfaceInformation(NetworkInterface netint) throws SocketException { 
     // TODO Auto-generated method stub 
     out.printf("Display name: %s\n", netint.getDisplayName()); 
     out.printf("Name: %s\n", netint.getName()); 
     Enumeration<InetAddress> inetAddresses = netint.getInetAddresses(); 

     for (InetAddress inetAddress : Collections.list(inetAddresses)) { 
      out.printf("InetAddress: %s\n", inetAddress); 
     } 

     out.printf("Up? %s\n", netint.isUp()); 
     out.printf("Loopback? %s\n", netint.isLoopback()); 
     out.printf("PointToPoint? %s\n", netint.isPointToPoint()); 
     out.printf("Supports multicast? %s\n", netint.supportsMulticast()); 
     out.printf("Virtual? %s\n", netint.isVirtual()); 
     out.printf("Hardware address: %s\n", 
        Arrays.toString(netint.getHardwareAddress())); 
     out.printf("MTU: %s\n", netint.getMTU()); 

     out.printf("\n"); 

    } 

} 

7 출력과 같은 코드를 작성

 
Display name: Software Loopback Interface 1 
Name: lo 
InetAddress: /0:0:0:0:0:0:0:1 
InetAddress: /127.0.0.1 
Up? true 
Loopback? true 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: [] 
MTU: -1 

Display name: WAN Miniport (SSTP) 
Name: net0 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (IKEv2) 
Name: net1 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (L2TP) 
Name: net2 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (PPTP) 
Name: net3 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (PPPOE) 
Name: ppp0 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (IPv6) 
Name: eth0 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (Network Monitor) 
Name: eth1 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (IP) 
Name: eth2 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: RAS Async Adapter 
Name: ppp1 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: Intel(R) 82567LM-3 Gigabit Network Connection 
Name: eth3 
InetAddress: /fe80:0:0:0:b1b1:7531:17b1:bf26%11 
InetAddress: /172.24.9.148 
Up? true 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: [120, 43, -53, 125, -80, 74] 
MTU: 1500 

Display name: Microsoft ISATAP Adapter 
Name: net4 
Up? false 
Loopback? false 
PointToPoint? true 
Supports multicast? false 
Virtual? false 
Hardware address: [0, 0, 0, 0, 0, 0, 0, -32] 
MTU: 1280 

Display name: Teredo Tunneling Pseudo-Interface 
Name: net5 
InetAddress: /fe80:0:0:0:e0:0:0:0%13 
Up? false 
Loopback? false 
PointToPoint? true 
Supports multicast? false 
Virtual? false 
Hardware address: [0, 0, 0, 0, 0, 0, 0, -32] 
MTU: 1280 

Display name: Microsoft ISATAP Adapter #2 
Name: net6 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: Intel(R) 82567LM-3 Gigabit Network Connection-QoS Packet Scheduler-0000 
Name: eth4 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: Intel(R) 82567LM-3 Gigabit Network Connection-WFP LightWeight Filter-0000 
Name: eth5 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (Network Monitor)-QoS Packet Scheduler-0000 
Name: eth6 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (IP)-QoS Packet Scheduler-0000 
Name: eth7 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 

Display name: WAN Miniport (IPv6)-QoS Packet Scheduler-0000 
Name: eth8 
Up? false 
Loopback? false 
PointToPoint? false 
Supports multicast? true 
Virtual? false 
Hardware address: null 
MTU: -1 
+2

이 항목이 StackOverflow에 있어야합니다. –

+2

이 목록과 명령 줄에서 ipconfig를 입력하는 관계는 무엇입니까? – Yishai

답변

3

윈도우 내부 사용을 위해 많은 인터페이스를 정의합니다. Java는 OS가 제공하는 것을 반환하며, Java에 의해 추가되지 않습니다.

Windows 레지스트리에서 이러한 모든 장치에 대한 항목을 찾을 수 있어야합니다.

+0

명령 프롬프트에서 ipconfig를 실행하면이 사실을 확인할 수 있습니다. Java 코드에서 얻은 것과 같은 목록이 표시됩니다. – Newtopian

+1

ipconfig는 IP 인터페이스 만 표시합니다. –

+0

답해 주셔서 감사합니다 피터와 요점은 레지스트리에있는 것입니다. 레지스트리에서 이러한 인터페이스를 찾을 수있었습니다. 이것은 ipconfig/all에서 얻는 것보다 조금 더 차이가 있습니까? 이전 버전과 조금 다릅니다. –

관련 문제