[CLUE-Tech] FW: Iptables scripting question

David Anselmi anselmi at americanisp.net
Sat Aug 30 16:25:18 MDT 2003


Not sure what the point of the JPGs you attached was...

Joe Daily wrote:

> I am redoing my iptables script and what I am trying to do is have the 
> network base be found as a function of the ip and netmask.
> 
> For example an ip of 192.168.2.3 and a netmask of 255.255.255.0 should 
> generate a base of 162.168.2.0
> 
> The iptables part is simple but how do I generate the network base, so I 
> can have iptables block it?

Not quite sure what you mean.  Probably you want to use 192.168.2.0/24 
where you specify the network to block in your script.

Trivia question:  Why would you want to write a netmask the long way 
(e.g., 255.255.255.0) rather than the short way (e.g., /24), assuming 
your application can accept either?

Dave






More information about the clue-tech mailing list