Re: mask 10 -> 29

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

 



Yeah, that is exactly why no one use decimals for network subdivision.

192.168.0.10-192.168.0.30 can not be matched with a single VLSM expression. The exact match would be a set:

192.168.0.10/31
192.168.0.12/30
192.168.0.16/29
192.168.0.24/30
192.168.0.28/31



--------------------------------------------------
From: "Gáspár Lajos" <swifty@xxxxxxxxxxx>
Sent: Wednesday, April 15, 2009 8:37 PM
To: "Mihamina Rakotomandimby (R12y)" <mihamina@xxxxxxxxxxxxxxx>
Cc: <netfilter@xxxxxxxxxxxxxxx>
Subject: Re: mask 10 -> 29

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

--
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