Is there a portable way to retrieve the local host subnet mask?

P

Pierre Rouleau

Hi all,

socket.gethostbyname_ex(socket.gethostname()) will return the list of IP
addresses on a the local host. I did not find any function that can be
used to get the subnet mask and default gateway.

Under Win32, the Win32 IP helper API provides a GetIpAddrTable()
function that returns information that contain the subnet mask, but
that's Win32 level, and is not portable. Is there something available
in the Python library for that purpose?


Thanks



Pierre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top