This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
netmask is wrong on Windows 7 64bit #32
Comments
It looks like an issue related to route table configuration. After I delete all route entries of 192.168.1.x, disable and enable the adapter to make route entries refreshed automatically, the issue is gone. netifaces should find some way to look the netmask in adapter's properties dialog instead of some entry in route table. Before clean-up
After clean-up. 0.0.0.0 0.0.0.0 192.168.3.1 192.168.3.100 26
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 276
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.1.0 255.255.255.0 On-link 192.168.1.2 276
192.168.1.2 255.255.255.255 On-link 192.168.1.2 276
192.168.1.255 255.255.255.255 On-link 192.168.1.2 276
192.168.3.0 255.255.255.0 On-link 192.168.3.100 281
192.168.3.100 255.255.255.255 On-link 192.168.3.100 281
192.168.3.255 255.255.255.255 On-link 192.168.3.100 281
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.3.100 281
224.0.0.0 240.0.0.0 On-link 192.168.1.2 276
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.3.100 281
255.255.255.255 255.255.255.255 On-link 192.168.1.2 276 |
Another test. >>> for i in netifaces.interfaces():
... if netifaces.AF_INET in netifaces.ifaddresses(i):
... for address in netifaces.ifaddresses(i)[netifaces.AF_INET]:
... print(address)
...
{'addr': '192.168.3.100', 'netmask': '255.255.255.0', 'broadcast': '192.168.3.255'}
{'addr': '192.168.0.100', 'netmask': '255.255.255.255', 'broadcast': '192.168.0.255'}
{'addr': '127.0.0.1', 'netmask': '255.0.0.0', 'broadcast': '127.255.255.255'} If I delete the entry
>>> for i in netifaces.interfaces():
... if netifaces.AF_INET in netifaces.ifaddresses(i):
... for address in netifaces.ifaddresses(i)[netifaces.AF_INET]:
... print(address)
...
{'addr': '192.168.3.100', 'netmask': '255.255.255.0', 'broadcast': '192.168.3.255'}
{'addr': '127.0.0.1', 'netmask': '255.0.0.0', 'broadcast': '127.255.255.255'} Meanwhile, I still can ping |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I got a wrong netmask which is set statically as
255.255.255.0
in adapter's properties dialog while it's255.255.255.255
from netifaces.The text was updated successfully, but these errors were encountered: