article on blocking by subnets

David Relson relson at osagesoftware.com
Tue Dec 3 02:38:33 CET 2002


At 08:19 PM 12/2/02, Graham Wilson wrote:
>e?  Would you care to?
>
>it wouldnt be to difficult, right? for an ip address 207.46.134.190 in
>the message, the lexer would return tokens:
>
>207
>207.46
>207.46.134
>207.46.134.190
>
>(the lexer now just returns the whole ip address, right?)

Correct.  The lexer currently returns the whole ip address.

Here's a bit of info on ip addresses:

IIRC, subnets come in 3 basic sizes - class A, class B, and class C.

Class A supports 16,000,000 hosts on 127 networks
Class B supports 65,000 hosts on 16,000 networks
Class C supports 254 hosts on 2,000,000 networks

The class of an address is determined by the first two bits.

Class A Network - binary address starts with 0, i.e. first octet is 1 to 126
Class B Network - binary address starts with 10, i.e. first octet is 128 to 191
Class C Network - binary address starts with 11, i.e. first octet is 192 to 223

To truly use the ip address would be to determine the class and create an 
appropriate token.  A less draconian method would be to use the first 3 
octets of the address, i.e. identify blocks of 256 addresses.





More information about the Bogofilter mailing list