Koozali.org: home of the SME Server

How to find current IP?

Pete Groom

How to find current IP?
« on: February 25, 2002, 09:39:30 PM »
I have a dial-up modem, and my ISP allocates a diffrent IP address every time the modem connect to the web.

Is the current IP address stored in a file on the E-Smith machine?

The file   /var/log/diald/accounting.log    tells me if I'm currently connected or not, but I need to know the current address as well. How can I obtain this?

Luke Drumm

Re: How to find current IP?
« Reply #1 on: February 25, 2002, 11:54:49 PM »
The command line utility of IfConfig provides a break down of ip addresses by their respective interfaces.

If you want to do it via code with a little more flair then it's also possible to go to the 'source' by delving into /proc.
Projects such as http://phpsysinfo.sourceforge.net/ may provide some clue as to how to do this.

Regards,
Luke

Pete Groom

Re: How to find current IP?
« Reply #2 on: February 26, 2002, 01:33:49 AM »
phpsysinfo is a great tip. It tells me lots of good information, and I made it work with no problems. I didn't realise you could achieve those results with so little effort.

If I only could make it display the ppp0 IP address, as seen from the web, I'd be a very happy man.

Kelvin

Re: How to find current IP?
« Reply #3 on: February 26, 2002, 08:49:21 AM »
Hi Pete,

I'm no expert but how's about this for an idea :

Write a script file which runs ifconfig and send the output to a text file.
grep the text file for the ppp0 line and extract what you need from it ??

(sorry, I'm mostly a Windoze man just learning Linux but this would be the sort of approach I'd take).

Kelvin

Andy Parkinson

Re: How to find current IP?
« Reply #4 on: February 26, 2002, 12:34:40 PM »
I believe the current ip address is displayed when you are online by going into server manager and into review configuration. I know my ip is there but then I have a cable modem and it may be different with dial up

Pete Groom

Re: How to find current IP?
« Reply #5 on: February 26, 2002, 08:49:50 PM »
Yes Andy, you are right. I've just looked and the external address is there. Thanks for pointing it out.

Does anyone know how to input the address from that page into Microsoft scripting language. I've tried "View source" and the address is not there, so I still can't get the address for use in a Windows script.

Dave Reinhardt

Re: How to find current IP?
« Reply #6 on: February 27, 2002, 09:24:50 PM »
a ping will show the IP from number

Pete Groom

Re: How to find current IP?
« Reply #7 on: February 28, 2002, 12:46:08 AM »
Ping doesn't seem to work through my E-Smith private server/gateway. I get "Timed out" every time. Is there a setting I need to adjust to be able to do successful pings?

Dave Reinhardt

Re: How to find current IP?
« Reply #8 on: February 28, 2002, 01:37:42 AM »
Ping is working
it told you you are not getting to the IP you pinged
Can you ping the nic in the computer you are pinging from?

Pete Groom

Re: How to find current IP?
« Reply #9 on: February 28, 2002, 10:41:44 PM »
Yes I can ping the local NIC.I can also ping to another local Windows ME machine.

I can't ping the E-Smith private server/gateway on 192.168.0.1, but I can still use use it with no problems, both as a file server and as a gateway (dial-up modem).

Using SSH to E-Smith I can see that E-Smith can ping addresses (numerical or text forms) on the internet.

I can't ping the same addresses from the Windows ME machines.

This is not too much of  a problem, but it would be good to understand what's happening here.