Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jun 2000 13:06:25 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        David Heller <dheller1@rochester.rr.com>
Cc:        The Clark Family <res03db2@gte.net>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Updating ipfw at dhcp induced ip address change.
Message-ID:  <20000619130625.A2365@hades.hell.gr>
In-Reply-To: <394AF076.3D7439C1@rochester.rr.com>; from dheller1@rochester.rr.com on Fri, Jun 16, 2000 at 11:28:54PM -0400
References:  <Pine.BSF.4.21.0006161851150.14076-100000@orthanc.dsl.gtei.net> <394AF076.3D7439C1@rochester.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000619130625.A2365>