From owner-freebsd-questions Wed May 12 21:36:32 1999 Delivered-To: freebsd-questions@freebsd.org Received: from out2.ibm.net (out2.ibm.net [165.87.194.229]) by hub.freebsd.org (Postfix) with ESMTP id 5B5D514FB8 for ; Wed, 12 May 1999 21:36:29 -0700 (PDT) (envelope-from mikegoe@ibm.net) Received: from Nikki.ibm.net (slip129-37-208-92.oh.us.ibm.net [129.37.208.92]) by out2.ibm.net (8.8.5/8.6.9) with SMTP id EAA72046; Thu, 13 May 1999 04:36:24 GMT From: "Michael G." To: alantrulock@erols.com (Alan Trulock) Subject: Re: Dynamic IP address Date: Wed, 12 May 1999 22:40:45 -0400 X-Mailer: KMail [version 1.0.17] Content-Type: text/plain References: <373b185a.71928112@smtp.erols.com> Cc: freebsd-questions@freebsd.org MIME-Version: 1.0 Message-Id: <99051300140801.00470@Nikki.ibm.net> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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