Usually I use ping to define ethernet status, such as:
Ping -c 1 - W 1 & lt; Ip_addr & gt;
How can we use the system call to determine the ethernet status? And how can we embed this method in Java code?
Ping does not determine ethernet status; It sends a packet and is waiting for a response, so it is used to test the end-to-end of a network.
You can definitely write your ping, there are many examples on the Internet, under Linux, you can usually be root to use the type of socket required.
If you really want to determine if the link is active,
ip link sh
Comments
Post a Comment