[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How do i find dynamic IP assigned?

On Tue, 2005-06-21 at 16:48 -0400, Patrick Rutkowski wrote: 
> On Tuesday 21 June 2005 04:39 pm, Valeriu Cerchez wrote:
> > I'm trying to find out a(/n easy) way to determine
> > what is my dynamic IP assigned by my ISP (not my
> > internal DHCP). I wish to make a script to determine
> > that by request.
> >
> > I would greatly appreciate any suggestion.
> > Thanks, Val.

I'm not sure anyone is going to 'write' the script for you.  How else
are you going to learn to do it? <g>  But, I'd look at ifconfig ppp0 and
grab the IP from there.  Another could be to find it in syslog where
pppd puts it's messages.  Mine looks something like

tail /var/log/syslog 
Jun 21 15:56:58 localhost pppd[8577]: local  IP address
Jun 21 15:56:58 localhost pppd[8577]: remote IP address
<rest of output>

uummm....  maybe you can find it in /proc somewhere too but I haven't reached that level success just yet..  Maybe someone else can clue us in..

Reply to: