Re: ipfw matching (revisited)

2002-11-12 Thread Matthew Seaman
On Tue, Nov 12, 2002 at 03:06:42PM +0100, Mark wrote:
 Ok, I constructed the following IP:mask for ipfw to match:
 
 202.43.64.0:255.255.191.0
 
 This is supposed to match the range 202.43.64.xx to 202.43.127.xx

Close, but no cigar.  You want:

202.43.64.0:255.255.192.0  also known as 202.43.64.0/18
  ^

That matches the addresses from 202.43.64.0 to 202.43.127.255
inclusive.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
  Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: ipfw matching (revisited)

2002-11-12 Thread Mark
- Original Message -
From: Matthew Seaman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 12, 2002 3:45 PM
Subject: Re: ipfw matching (revisited)


 On Tue, Nov 12, 2002 at 03:06:42PM +0100, Mark wrote:
  Ok, I constructed the following IP:mask for ipfw to match:
 
  202.43.64.0:255.255.191.0
 
  This is supposed to match the range 202.43.64.xx to
  202.43.127.xx

 Close, but no cigar.  You want:

 202.43.64.0:255.255.192.0  also known as 202.43.64.0/18
  ^

 That matches the addresses from 202.43.64.0 to 202.43.127.255
 inclusive.


Thanks for the explanation. Yes, 191 (1011) would only have bit 6
variable; indeed, I needed 192 (1100), to keep the lower 6 bits
variable. It is clear to me now.

Good thing I asked! :)

- Mark


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message