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 ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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