Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Local ip parsing shouldn't use ifconfig #18

Open
chadbrubaker opened this issue Nov 11, 2014 · 2 comments
Open

Local ip parsing shouldn't use ifconfig #18

chadbrubaker opened this issue Nov 11, 2014 · 2 comments

Comments

@chadbrubaker
Copy link
Contributor

As seen in #17 ifconfig output is platform dependent and we should find a more platform independent way to find all the ip addresses bound to interfaces.

@nikhilgeo
Copy link

Python netifaces package can be made used to find the IP address of the all the interfaces.

from netifaces import interfaces, ifaddresses, AF_INET
for ifaceName in interfaces():
addresses = [i['addr'] for i in ifaddresses(ifaceName).setdefault(AF_INET, [{'addr':'No IP addr'}] )]
print '%s: %s' % (ifaceName, ', '.join(addresses))

@jack17529
Copy link

Can I work on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants