On Sat, 17 Oct 1998, Marc Corel wrote:
> Hi,
> I know I should do:
> ipfwadm -F -p deny
> ipfwadm -F -a m -S 192.168.1.0/24 -D 0.0.0.0/0
> (if I want Internet access to all nodes of my local network adress
> 192.168.1.0)..
> But..what does the "24" number meanning??
The "24" signifies the number of ones in the netmask which is a 32 bit
binary number starting from the leftmost or the MSB (most significant bit)
the remaining 8 bits would simply be "0". From there you can then
transform it to a dotted quad format.
Here is a example with 192.168.1.0/24, we can breakdown the netmask to
Most Significant Bit
|
11111111.11111111.11111111.00000000
255 . 255 . 255 . 0
So you would end-up with a netmask of 255.255.255.0
If you may wonder what a netmask is well it is some sort of filter in
order to extract the network address of any IP number. In order to get the
network address you have todo a logical AND operation with the IP number
and the Netmask.. Sample,
The current IP that you have right now is "192.168.0.0" with a netmask
of "/24".
IP Number - 192 . 168 . 0 . 0
Binary Equivalent - 11000000.10101000.00000000.00000000
&&
/24 - 11111111.11111111.11111111.00000000
--------------------------------------
11000000.10101000.00000000.00000000
Network Address - 192 . 168 . 0 . 0
Another info in which you can get from the Netmask is the number of host
in which this particular network can hold. In this case
/24 - 11111111.11111111.11111111.00000000
1 - Signifies the Network-bits.
0 - Signifies the Host-bits.
So in this case you can determine the number of host or member of the
network would be, by getting the number of 0 in the netmask.
host-bits
The usual formula goes Host = 2 - 2
the reason why we subtracted 2 is because you cannot give the
network address and broadcast address to host except for when the
total number of host-bits is equal to 0 in that case you would be
pertaining to a single host just like your question regarding the /32
host-bits
Host = 2 - 2
8
= 2 - 2
= 256 - 2
Host = 254 or all PC belonging to this network.
>
> Same question for 2 of my terminals to which I allow internet access:
> ipfwadm -F -a m -S 192.168.1.6/32 -D 0.0.0.0/0
> ipfwadm -F -a m -S 192.168.1.8/32 -D 0.0.0.0/0
> (what is the number 32 ..for??)
In this case your Netmask would be.
11111111.11111111.111111111.11111111
Host-bits = 0 (since you don't have any host-bits around)
You would pertaining specifically to this PC as a Host.
regards,
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Val T. dela Rosa <[EMAIL PROTECTED]> IPhil Comm. Network Inc.
Senior Technical Support Specialist 116 Herrera St.,
Legaspi Village
Tel No. : (63 2) 750-2288 Makati City 1229
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]