Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 210400

Re: Regarding subnet mask of a virtual machine.

$
0
0

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


Viewing all articles
Browse latest Browse all 210400

Trending Articles