title: Find network adapter name for ethernet connection
body: <p>I need to find the adapter name and default gateway for the ethernet adapter used to connect to the internet.</p>
  
  <p>I can get the gateway with <code>netstat -rn</code> but I'm having problem with the adapter name.</p>
  
  <p>I'm using java and running a <code>ipconfig</code> command for Windows systems and parsing the result. It returns the network adapter names in this format</p>
  
  <pre>
  Ethernet adapter Local Area Connection:
  
     Connection-specific DNS Suffix  . : customer.service.provider.lan
     Link-local IPv6 Address . . . . . : fb80::7d2b:98aa:506:685%10
     IPv4 Address. . . . . . . . . . . : 10.65.2.21
     Subnet Mask . . . . . . . . . . . : 255.255.192.0
     Default Gateway . . . . . . . . . : 10.65.0.1
  </pre>
  
  <p>I can match the default gateway and like to parse the string "Local Area Connection" for it. On English locale, I can look for the word "adapter" and parse the name until ":". Problem is on computers with different locale than English, "adapter" is called something else. How can I reliably obtain the network adapter name?</p>