punch_card_don has asked for the wisdom of the Perl Monks concerning the following question:
I have a long list of IPs and IP ranges that correspond to various users. Then I'm given a single IP address and need to determine which user it is. For example, my user IPs might look like:
User 1 = abc.def.ghi.001 abc.def.ghi.002 abc.def.ghi.003
User 2 = jkl.mno.pqr.0/255.255.192.0
User 2 = stu.vwx.0.0/255.255.192.0 (yes, another range for User 2)
and so on for dozens or hundreds of users.
Then, given a single IP adress, determine which user it is. Prefereably without having to do something brute force like looping through every range with a subnet mask module to test against my IP.
All good ideas will be greatly appreciated.
Thanks
Time flies like an arrow. Fruit flies like a banana.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Quickly determine which IP range an IP belongs to. (two keys)
by tye (Sage) on Nov 30, 2010 at 05:40 UTC | |
Re: Quickly determine which IP range an IP belongs to.
by ikegami (Patriarch) on Nov 30, 2010 at 01:59 UTC | |
Re: Quickly determine which IP range an IP belongs to.
by Anonymous Monk on Nov 30, 2010 at 05:57 UTC | |
Re: Quickly determine which IP range an IP belongs to.
by BrowserUk (Patriarch) on Nov 30, 2010 at 10:07 UTC | |
Re: Quickly determine which IP range an IP belongs to.
by valdez (Monsignor) on Nov 30, 2010 at 14:10 UTC | |
Re: Quickly determine which IP range an IP belongs to.
by salva (Canon) on Nov 30, 2010 at 07:05 UTC | |
Re: Quickly determine which IP range an IP belongs to.
by punch_card_don (Curate) on Nov 30, 2010 at 12:55 UTC |