• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 783
  • Last Modified:

Get subnet mask for local computer ?

Greetings from sunny Melbourne Australia,

I want to get the subnet mask associated with the local PC's address.

I understand how to use hostname() and gethostbyname() to get a list of one or more addresses for this PC but I need to know whether this PC is on the same network as another address - hence my need for the subnet mask.

Can anybody help ?

Thanks in Advance
mjsmith99@hotmail.youknowwhat
0
mjsmith99
Asked:
mjsmith99
1 Solution
 
jhanceCommented:
See:

http://www.caip.rutgers.edu/~arni/ws2/stas.htm

The technique described here will get you both your IP and netmask.
0
 
mjsmith99Author Commented:
I awarded the points to Nick because of his excellent source code.  jhance's answer was also useful.

Thanks,
Mike
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now