From owner-freebsd-questions Mon Jun 19 1:50:38 2000 Delivered-To: freebsd-questions@freebsd.org Received: from athserv.otenet.gr (athserv.otenet.gr [195.170.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 095A637B6CC for ; Mon, 19 Jun 2000 01:50:34 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from hades.hell.gr (patr530-b112.otenet.gr [195.167.121.240]) by athserv.otenet.gr (8.10.1/8.10.1) with ESMTP id e5J8npH10391; Mon, 19 Jun 2000 11:49:51 +0300 (EET DST) Received: (from charon@localhost) by hades.hell.gr (8.10.2/8.10.2) id e5JA6Qr02419; Mon, 19 Jun 2000 13:06:26 +0300 (EEST) Date: Mon, 19 Jun 2000 13:06:25 +0300 From: Giorgos Keramidas To: David Heller Cc: The Clark Family , freebsd-questions@FreeBSD.ORG Subject: Re: Updating ipfw at dhcp induced ip address change. Message-ID: <20000619130625.A2365@hades.hell.gr> References: <394AF076.3D7439C1@rochester.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <394AF076.3D7439C1@rochester.rr.com>; from dheller1@rochester.rr.com on Fri, Jun 16, 2000 at 11:28:54PM -0400 X-PGP-Fingerprint: 3A 75 52 EB F1 58 56 0D - C5 B8 21 B6 1B 5E 4A C2 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Jun 16, 2000 at 11:28:54PM -0400, David Heller wrote: > > And to find your ip: > > extip="`/sbin/ifconfig fxp1 | grep ' | awk '{print $2}' | sed -e 's/.*://`'" > > will return your outside ip > ... > Don't ask me how that command works I got it off a Linux Howto. Actually, sorry to disappoint you, but it won't. That " grep ' " in there is probably meant to be lo0 for this to work on Linux. And at the end of the command, the quotes around sed's expression are probably the other way around, as in "sed -e 's/.*://'`", instead of "sed -e 's/.*://`'". ^^ see here One way to get the IP address of an interface in BSD is by using netstat and a few pipes to do the filtering of netstat's output. % netstat -in | grep lo0 | grep -iv link | awk '{print $4}' > Remember to disable your firewall in rc.conf!!. No need to, ipfw works fine with dynamic IP addresses too :-) -- Giorgos Keramidas, < keramida @ ceid . upatras . gr > For my public key: finger keramida@ceid.upatras.gr To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message