Re: mask 10 -> 29

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Mihamina Rakotomandimby (R12y) írta:
Hi,
I have this kind of shell script in order to set something on a bunch of IP addresses:

for ACCEPTED_MACHINE in \
    192.168.0.10 \
...
   192.168.0.29
do
$IPTABLES [...]
done


How could I use a mask such as 192.168.0.0/NN to exactly match the list?
Thank you.

Use ipcalc!

The closest subnet is:

ipcalc 192.168.0.10/27
Address:   192.168.0.10         11000000.10101000.00000000.000 01010
Netmask:   255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Wildcard:  0.0.0.31             00000000.00000000.00000000.000 11111
=>
Network:   192.168.0.0/27       11000000.10101000.00000000.000 00000
HostMin:   192.168.0.1          11000000.10101000.00000000.000 00001
HostMax:   192.168.0.30         11000000.10101000.00000000.000 11110
Broadcast: 192.168.0.31         11000000.10101000.00000000.000 11111
Hosts/Net: 30                    Class C, Private Internet

Check HosMin and HostMax!

Swifty


--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux