1

For example, I have a file ( city and ip addresses ):

....
City1 31.25.87.0 - 31.25.87.15
 .... .... 
City2 31.47.224.0 - 31.47.255.255
....

How to know by ip adress city name ?

asked Nov 30, 2011 at 13:25

1 Answer 1

1

http://www.icir.org/robin/pysubnettree/

you may need to convert ip ranges in cidr, so this library can help you

http://code.google.com/p/python-iptools/

Please consider that converting ip ranges to cidrs you may have multiple cidr blocks so you have to repeat the city in the tree

answered Nov 30, 2011 at 13:35
Sign up to request clarification or add additional context in comments.

1 Comment

Looks no method works to convert ip range to cidrs in python-iptools module. Find another module for converting github.com/jathanism/cidrize

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.