From owner-freebsd-pf@FreeBSD.ORG Tue May 6 10:06:58 2008 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E99991065676 for ; Tue, 6 May 2008 10:06:58 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id DF0B48FC2C for ; Tue, 6 May 2008 10:06:58 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id CB69C1CC038; Tue, 6 May 2008 03:06:58 -0700 (PDT) Date: Tue, 6 May 2008 03:06:58 -0700 From: Jeremy Chadwick To: Vitaliy Vladimirovich Message-ID: <20080506100658.GA3813@eos.sc1.parodius.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-pf@freebsd.org Subject: Re: dst_addr and subdomains X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2008 10:06:59 -0000 On Tue, May 06, 2008 at 12:47:24PM +0300, Vitaliy Vladimirovich wrote: > Hi! > ow can I specify dst_addr in my rule for all subdomains of server. E.g. example1.server.com, example2.server.com and so on. > > Something like this: > > pass out on sk0 inet proto tcp from $MY_LAN to *.example.org port www What you want is basically a layer 7 filter -- pf does not do that. If all the machines within *.example.org are within a specific network block (e.g. 20.30.40.0/24), then you can use that CIDR netblock instead of *.example.org in your above example. But you cannot use wildcards for domains. All hostnames given as a dst/src address will be resolved first. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |