From owner-freebsd-questions Sun Dec 30 14:32:41 2001 Delivered-To: freebsd-questions@freebsd.org Received: from smtp-1.enteract.com (smtp-1.enteract.com [207.229.143.33]) by hub.freebsd.org (Postfix) with ESMTP id B0CAE37B405 for ; Sun, 30 Dec 2001 14:32:38 -0800 (PST) Received: from jamestown.21stcentury.net (24-148-18-116.na.21stcentury.net [24.148.18.116]) by smtp-1.enteract.com (Postfix) with ESMTP id E05A66037; Sun, 30 Dec 2001 16:32:37 -0600 (CST) Received: (from jtm@localhost) by jamestown.21stcentury.net (8.11.6/8.11.3) id fBUMWbE09452; Sun, 30 Dec 2001 16:32:37 -0600 (CST) (envelope-from jtm63@enteract.com) X-Authentication-Warning: jamestown.21stcentury.net: jtm set sender to jtm63@enteract.com using -f To: "Cambria, Mike" Cc: "'Joe & Fhe Barbish'" , FBSD Questions Subject: Re: IPFW rc.firewall References: <3A6D367EA1EFD4118C9B00A0C9DD99D7065380@rerun.lucentctc.com> From: James McNaughton Date: 30 Dec 2001 16:32:36 -0600 In-Reply-To: <3A6D367EA1EFD4118C9B00A0C9DD99D7065380@rerun.lucentctc.com> Message-ID: <86u1u85ofv.fsf@jamestown.21stcentury.net> Lines: 17 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Cambria, Mike" writes: > This is what I use in rc.firewall for a DHCP assigned IPv4 address: > > > onet=`ifconfig vx0 | grep "inet " | awk '{print $6}'` > > oip=`ifconfig vx0 | grep "inet " | awk '{print $2}'` > > omask=`ifconfig vx0 | grep "netmask" | awk '{print $4}'` > As an aside, you may be interested in knowing that awk will do its own regexp pattern matching ala, oip=`ifconfig ep1 | awk '/inet / {print $2}'` To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message