Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 May 1999 22:40:45 -0400
From:      "Michael G." <mikegoe@ibm.net>
To:        alantrulock@erols.com (Alan Trulock)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Dynamic IP address
Message-ID:  <99051300140801.00470@Nikki.ibm.net>
References:  <373b185a.71928112@smtp.erols.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ok, Thanks!

Michael G.

On Wed, 12 May 1999, you wrote:
> How about
> 
> echo `ifconfig tun0 | tail -1 | awk '{print $2}'`
> 
> or write it to a file
> 
> echo `ifconfig tun0 | tail -1 | awk '{print $2}'` > /etc/myip
> 
> or do this and use it in a script
> 
> setenv MYIP `ifconfig tun0 | tail -1 | awk '{print $2}'`
> 
> 
> --Alan
> 
> 
> On Thu, 13 May 1999 09:31:08 +1000, you wrote:
> 
> >On Wed, 12 May 1999 at 18:58:00 -0400, Michael G. wrote:
> >> I checked the archives ..but couldn't find this answer...
> >> 
> >> How can I check what my current IP address when I log into my
> >> ISP...as it is dynamically allocated at connection?   arp didn't
> >> seem to get me anywhere because I don't know what my machine is
> >> called???...from the outside...
> >
> >Try 'netstat -rn'.  It'll give you something like this..
> >
> >[jim@blues:~]$ netstat -rn
> >Routing tables
> >
> >Internet:
> >Destination        Gateway            Flags     Refs     Use     Netif
> >Expire
> >default            203.37.7.2         UGSc       11        0     tun0
> >127.0.0.1          127.0.0.1          UH          0    41002      lo0
> >203.37.7.2         203.37.48.130      UH         12        0     tun0
> >                   ^^^^^^^^^^^^^ that should be your ip
> >
> >Also, 'ifconfig tun0' will provide it as well..


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?99051300140801.00470>