Quantcast
Viewing all articles
Browse latest Browse all 185574

Re: Regarding subnet mask of a virtual machine.

Here is script. The netmask of the first address of the  interface:



InetAddress localHost = Inet4Address.getLocalHost();

NetworkInterface networkInterface = NetworkInterface.getByInetAddress(localHost);

for (InterfaceAddress address : networkInterface.getInterfaceAddresses()) {
    System.out.println(address.getNetworkPrefixLength());
}

Regards,
Milton Image may be NSFW.
Clik here to view.


Viewing all articles
Browse latest Browse all 185574

Trending Articles