IP Address Management

kcnychief

??? ??? ?
Political Access
Joined
8 Apr 2005
Messages
16,950
I have alot of clients that I need to manage IP Addresses for. They all have DSL or Cable and none of them are static, so once and a great while they change. I have them all trained to visit http://www.whatismyip.com if the address changes and report back to me, so that is all working good. My only question is, if anyone else out there manages alot of IP's, how do you manage them?

Currently I have them in an .xls on my Axim, but I didn't know if anyone else out there had other methods, something that might be easier for me or more convenient. Anyone got some input on that?
 
We manage about 200 clients in about the same way. Only difference is, all of our systems are Unix based, and we simply wrote a little cron that runs every 15 min and reports the IP of the client and saves it to a log file. We did put a small piece of code on our website that returns the viewers ip, but that's not much different than whatismyip.com. It is a bit easier for us that way because we put a shortcut to the site on their desktops and they can get to it fairly quickly.
 
Yeah, I put the shortcut to the URL on the desktop too, I just need the users to report changes. No cron jobs here :)
 
I keep track of my network's IP scheme using an spreadsheet also.
 
am assuming an axis is some kind of pda device, if it has mobile connectivity could you not simply have a script on a server somewhere that you get them to go to which then catches the IP address and stores it in a database for you.

Something like a Scheduled Task that runs periodically, something that for example uses MSIE or some scripted version of MSIE that checks a url like http://www.domain.com/ip.php?id=12367834 that would then get the ip address from the $_SERVER['REMOTE_ADDR'] variable and then stores that in a database using the id value. You could then look this up with another script that just dumps the information into a text file that you can read, or into a CSV that you could import into Excel
 
'cuse the double post, but they are separate really... honest :p
and yeah, I got bored...

When you set them up you goto the add page and add them to the system, this should return you an ip number to use for the client. You would then create a shortcut to open http://www.domain.com/ip.php?id=123

The show page is then able to just dump the information out of the database and output into plain text.

A PHP version might look something like this

SQL Table creation
Code:
CREATE TABLE dsl_ip (
    uid INT( 11 ) NOT NULL AUTO_INCREMENT,
    name TEXT NOT NULL,
    ip TEXT NOT NULL,
    PRIMARY KEY ( uid )
);

ip.php
PHP:
<?php
$sqldb = mysql_connect('localhost','username','password');
mysql_select_db('dsl');

$uid = strip_tags(trim($_GET['id']));
$uid = (int)$uid;       // just to make sure its an integer

$ip = $_SERVER['REMOTE_ADDR'];
$uSql = "UPDATE TABLE dsl_ip ( ip ) VALUES ( '{$ip}' ) WHERE uid = '{$uid}'";
$uResult = mysql_query($uSql, $sqldb);

// maybe give them a thankyou message
echo "Thank you";
?>

add.php
PHP:
<?php
if ($_POST['submit'] == "Add") {
    $sqldb = mysql_connect('localhost','username','password');
    mysql_select_db('dsl');
    
    $desc = strip_tags(trim($_POST['desc']));
    
    $ip = $_SERVER['REMOTE_ADDR'];
    $iSql = "INSERT INTO dsl_ip ( ip, desc ) VALUES ( '{$ip}', '{$desc}' )";
    $iResult = mysql_query($iSql, $sqldb);
    $uid = mysql_insert_id($iResult);
    
    echo "Client Added ID is {$uid}";
} else {
$html =<<<EOF
<html>
<head><title>Add New Client</title></head>
<body>
<form method="post" action="$_SERVER['PHP_SELF']">
<label for="desc">Description: <input type="text" name="desc" size="30"/></label>
<input type="submit" name="submit" value="Add Client"/>
</form>
</body>
</html>
EOF;
echo $html;
}
?>

show.php
PHP:
<?php
header("Content-Type: text/plain");

$sqldb = mysql_connect('localhost','username','password');
mysql_select_db('dsl');

$sSql = "SELECT ip, desc FROM dsl_ip ORDER BY uid ASC";
$sResult = mysql_query($sSql, $sqldb);

while($row = mysql_fetch_array($sResult)) {
    echo "{$row['ip']} - {$row['desc']}\n";
}
?>
 
That is crazy dude, did you just write that from scratch in like 10-20 minutes?

In awe of you, reps for just being crazy smart :eek:
 
PHP/MySQL is nice for just throwing stuff together adhoc in 20-30 minutes :)
 
yar, just chucked it together, I did forget to mention though that you need to have a database called 'dsl', if its called something else then change the
mysql_select_db('dsl'); to mysql_select_db('name of database');
 
I don't know if this would help but theres this site called no-ip.org It gives you a url for other people to connect to and then the person runs a program on their system and it keeps track of the persons ip by relaying it to the no-ip site. Maybe you can some how incorporate that into ip tracking.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back