Networking Forums

Networking Forums > Computer Networking > Linux Networking > x.x.x.x/N notation question

Reply
Thread Tools Display Modes

x.x.x.x/N notation question

 
 
Bit Twister
Guest
Posts: n/a

 
      12-21-2005, 04:29 AM
I do not understand x.x.x.x/N notation.

Could someone reply with a url or discription of how it works.
Browsing through network HowTos has not helped.

I am trying to use it in my firewall rules to block some networks.

I thought it was number of bits but that did not pan out when looking
at the following

124.0.0.0/7
126.0.0.0/8
169.208.0.0/12
196.192.0.0/13
 
Reply With Quote
 
 
 
 
ynotssor
Guest
Posts: n/a

 
      12-21-2005, 04:48 AM
"Bit Twister" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> I do not understand x.x.x.x/N notation.
> Could someone reply with a url or discription of how it works.


I find http://bob.marlboro.edu/~msie/2003/i...ep14/ipcalc.pl to be
most helpful.

> I thought it was number of bits but that did not pan out when looking
> at the following
> 124.0.0.0/7


e.g.:
Address: 124.0.0.0 0111110 0.00000000.00000000.00000000
Netmask: 254.0.0.0 = 7 1111111 0.00000000.00000000.00000000
Wildcard: 1.255.255.255 0000000 1.11111111.11111111.11111111
=>
Network: 124.0.0.0/7 0111110 0.00000000.00000000.00000000 (Class A)
Broadcast: 125.255.255.255 0111110 1.11111111.11111111.11111111
HostMin: 124.0.0.1 0111110 0.00000000.00000000.00000001
HostMax: 125.255.255.254 0111110 1.11111111.11111111.11111110
Hosts/Net: 33554430

 
Reply With Quote
 
Ken Sims
Guest
Posts: n/a

 
      12-21-2005, 05:53 AM
Hi -

On Tue, 20 Dec 2005 23:29:31 -0600, Bit Twister
<(E-Mail Removed)> wrote:

>I do not understand x.x.x.x/N notation.
>
>Could someone reply with a url or discription of how it works.
>Browsing through network HowTos has not helped.
>
>I am trying to use it in my firewall rules to block some networks.
>
>I thought it was number of bits but that did not pan out when looking
>at the following


N is the number of bits, starting from the left, that don't change. It
defines a range where the bits following the first N bits range from
all zeros to all ones.

>124.0.0.0/7


124.0.0.0 as bits = 01111100 00000000 00000000 00000000
First seven bits = ^^^^^^^
7 fixed, rest 0s = 01111100 00000000 00000000 00000000
7 fixed, rest 1s = 01111101 11111111 11111111 11111111

01111100 00000000 00000000 00000000 = 124.0.0.0
01111101 11111111 11111111 11111111 = 125.255.255.255

So 124.0.0.0/7 defines the range of 124.0.0.0 to 125.255.255.255.

125.255.255.255/7 also defines that same range as does any IP address
in that range with /7, but it is traditional (and easier to follow)
when all bits after the first N bits are zero. And some software
insists on it being that way.

Since there are 32 bits in an IPv4 IP address, N must be 0 to 32.
/0 defines the entire range of IPv4 IP addresses.
/32 defines a single IP address.

--
Ken
http://www.ke9nr.net/
 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      12-21-2005, 06:19 AM
On Tue, 20 Dec 2005 21:48:46 -0800, ynotssor wrote:
> "Bit Twister" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> I do not understand x.x.x.x/N notation.
>> Could someone reply with a url or discription of how it works.

>
> I find http://bob.marlboro.edu/~msie/2003/i...ep14/ipcalc.pl to be
> most helpful.


Hmmm, Bob needs to fix his example.
Using the example in the code, I get

$ ipcalc.pl 230.143.254.1/25
/home/bittwister/work/ipcalc.pl: error: First byte must be 1-223,
I do not handle multicast or experimental
usage: /home/bittwister/work/ipcalc.pl IPv4_address[/mask]
mask can be number of bits (0-32) or dotted quad

To me my first byte is 2, now had he indicated
first quad (230) must be 1-223 it would have helped.


>> I thought it was number of bits but that did not pan out when looking
>> at the following
>> 124.0.0.0/7

>
> e.g.:
> Address: 124.0.0.0 0111110 0.00000000.00000000.00000000
> Netmask: 254.0.0.0 = 7 1111111 0.00000000.00000000.00000000
> Wildcard: 1.255.255.255 0000000 1.11111111.11111111.11111111
> =>
> Network: 124.0.0.0/7 0111110 0.00000000.00000000.00000000 (Class A)
> Broadcast: 125.255.255.255 0111110 1.11111111.11111111.11111111
> HostMin: 124.0.0.1 0111110 0.00000000.00000000.00000001
> HostMax: 125.255.255.254 0111110 1.11111111.11111111.11111110
> Hosts/Net: 33554430


So it is the number of bits, my fault for counting from the right
instead of the left. That is what I get for reading about Netmask and
thinking the 0s were the wildcard mask to get the actual ip addy.

Also does not help being a hardware tech knowing about and, nand, or,
xor logic and software numbering bits starting on the right.

Thank you.

 
Reply With Quote
 
ynotssor
Guest
Posts: n/a

 
      12-21-2005, 08:23 AM
"Bit Twister" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> > I find http://bob.marlboro.edu/~msie/2003/i...ep14/ipcalc.pl to

be
> > most helpful.

>
> Hmmm, Bob needs to fix his example.
> Using the example in the code, I get
>
> $ ipcalc.pl 230.143.254.1/25
> /home/bittwister/work/ipcalc.pl: error: First byte must be 1-223,
> I do not handle multicast or experimental
> usage: /home/bittwister/work/ipcalc.pl IPv4_address[/mask]
> mask can be number of bits (0-32) or dotted quad
>
> To me my first byte is 2, now had he indicated
> first quad (230) must be 1-223 it would have helped.


Hmmm, I must have a different version:
$ ./ipcalc.pl 230.143.254.1/25
Address: 230.143.254.1 11100110.10001111.11111110.0 0000001
Netmask: 255.255.255.128 = 25 11111111.11111111.11111111.1 0000000
Wildcard: 0.0.0.127 00000000.00000000.00000000.0 1111111
=>
Network: 230.143.254.0/25 11100110.10001111.11111110.0 0000000 (Class D)
Broadcast: 230.143.254.127 11100110.10001111.11111110.0 1111111
HostMin: 230.143.254.1 11100110.10001111.11111110.0 0000001
HostMax: 230.143.254.126 11100110.10001111.11111110.0 1111110
Hosts/Net: 126

> So it is the number of bits, my fault for counting from the right
> instead of the left.


I thought that that might have been the case, but a picture is worth a
thousand words, as they say.

> Thank you.


You're welcome.

 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      12-21-2005, 09:38 AM
On Wed, 21 Dec 2005 01:23:17 -0800, ynotssor wrote:
>
>I find http://bob.marlboro.edu/~msie/2003/i...ep14/ipcalc.pl to
>
> Hmmm, I must have a different version:
> $ ./ipcalc.pl 230.143.254.1/25


I'll guess so, I used the supplied link and

$ type ipcalc.pl
ipcalc.pl is hashed (/home/bittwister/work/ipcalc.pl)

indicates that is the one I donwloaded and is the one which runs.

 
Reply With Quote
 
Baho Utot
Guest
Posts: n/a

 
      12-21-2005, 08:40 PM
On Tue, 20 Dec 2005 23:29:31 -0600, Bit Twister shouted Hoy......

>
>
> I do not understand x.x.x.x/N notation.
>
> Could someone reply with a url or discription of how it works.
> Browsing through network HowTos has not helped.
>
> I am trying to use it in my firewall rules to block some networks.
>
> I thought it was number of bits but that did not pan out when looking
> at the following
>
> 124.0.0.0/7
> 126.0.0.0/8
> 169.208.0.0/12
> 196.192.0.0/13


It is cidr

Have a look at:

http://learnlinux.tsf.org.za/courses...n/ch01s12.html

--
Dancin' in the ruins tonight
mail: echo onub-(E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
Tayo'y Mga Pinoy

 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      12-21-2005, 11:33 PM
On Tue, 20 Dec 2005, in the Usenet newsgroup comp.os.linux.networking,
in article <(E-Mail Removed)>, ynotssor wrote:

>"Bit Twister" <(E-Mail Removed)> wrote


>> I do not understand x.x.x.x/N notation.
>> Could someone reply with a url or discription of how it works.

>
>I find http://bob.marlboro.edu/~msie/2003/i...ep14/ipcalc.pl to be
>most helpful.


1878 Variable Length Subnet Table For IPv4. T. Pummill, B. Manning.
December 1995. (Format: TXT=19414 bytes) (Obsoletes RFC1860) (Status:
INFORMATIONAL)

It also includes references to the CIDR documents that caused all of this.
RFC1878 is available at many sites on the web.

Old guy
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
192.168.10.0/24 - why /24 ? instead of 192.168.10/# notation query Scott Windows Networking 5 10-17-2008 01:12 PM
Subnet Mask, Decimal, Slash Notation. Robert Bollinger Windows Networking 3 10-07-2007 02:05 AM
IP range notation Colin Wilson Broadband 17 01-26-2005 12:56 PM
IP Address Notation Frank A. Uepping Linux Networking 1 11-04-2003 12:30 PM
Help with CIDR notation Siddharth Mathur Linux Networking 2 09-08-2003 04:10 PM



1 2 3 4 5 6 7 8 9 10 11