문제

I am writing a java application which has to be able to turn on (WOL which is workin fine) and shut down a pc on the local network. The thing is I want it to be able to do both while only providing the MAC-address. What I need is a way to get the ip-address of a pc (if powered on) by providing only its MAC-address. I see a lot of thread about doing the opposite but this seemed like a dead end.

Thanks in advance Krolden

도움이 되었습니까?

해결책

This isn't possible in the general case; IP addresses and MAC addresses have a many-to-many relationship (most interfaces have multiple IP addresses, and a single IP address can be bound to multiple MACs, though this latter is usually in a load-balancing scenario).

The InARP protocol is available on Frame Relay, but is not applicable to Ethernet.

The closest you can get--and this is unreliable for a number of reasons--is to broadcast ping the subnet the target computer is on after giving it time to wake up. You can then inspect the ARP cache on the local computer to find a matching entry.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top