• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getting IP address of Interface whose network cable is unplugged

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I have a system with three NIC each on different subnet. I am working on a code that wants me to get the ip address of all the interfaces even if no network cable is connected to them. I dont need the IP addresses of the disabled interfaces. Please help me. It kinda urgent!!
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Suparn Gupta wrote:It kinda urgent!!


Please EaseUp. There is no such thing as urgent around here.
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you already check out what you can do with java.net.NetworkInterface?
 
Suparn Gupta
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah I have checked the java.net package. When I enumerate the network interfaces using getNetworkInferfaces() it doesnt show the nic whose cable is unplugged. Even if I use netsh tool and extract the ip addresses from the output of the command, it wont do my job. I must get a NetworkInterface object for every interface as I have to use it in further code.

Take your time :-)
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Suparn Gupta wrote:Yeah I have checked the java.net package. When I enumerate the network interfaces using getNetworkInferfaces() it doesnt show the nic whose cable is unplugged. Even if I use netsh tool and extract the ip addresses from the output of the command, it wont do my job. I must get a NetworkInterface object for every interface as I have to use it in further code.

Take your time :-)




I believe the java.net package only reports the NICs which are visible via the OS ... meaning if you run "ipconfig" (windows) or "ifconfig" (unix), it should show up. If it doesn't, there is nothing that can be done at the Java layer, it's a operating system or networking issue (you need to talk to your system or network administrator).

Henry
 
Suparn Gupta
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Henry!

I too suspect that. I ll contact my lab admin and see what he has to say.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic