and if you want to be extra careful (or just plain pedantic :)...

some IP addresses while valid in form are not valid in practice. these are the martians and the unallocated.

the martians are reserved addresses that shouldn't be seen on the internet as a whole. but some of them can be used on local networks.

the unallocated are IP addresses that have not been allocated out of the global pool. these you shouldn't see at all (and shouldn't accept either).

you can find the current lists through a handy whois query.

$ whois -h whois.radb.net fltr-martian filter-set: fltr-martian filter: { 0.0.0.0/8^+ , 10.0.0.0/8^+ , 127.0.0.0/8^+ , 169.254.0.0/16^+ , 172.16.0.0/12^+ , 192.0.2.0/24^+ , 192.168.0.0/16^+ , 198.18.0.0/15^+ , 224.0.0.0/3^+ } descr: Special use and reserved IPv4 prefixes. remarks: For the complete set of bogons, please see: fltr-unallocated - unallocated prefixes. fltr-bogons - fltr-unallocated + fltr-martian. http://www.cymru.com/Documents/bogon-list.html admin-c: Rob Thomas RT624 tech-c: Rob Thomas RT624 notify: radb@cymru.com mnt-by: MAINT-BOGON-FILTERS changed: radb@cymru.com 20021229 changed: radb@cymru.com 20021230 changed: radb@cymru.com 20021230 source: RADB ...

do the same to find fltr-unallocated.


In reply to Re^3: IP address matching by Anonymous Monk
in thread IP address matching by oliverm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.