Networking Forums

Networking Forums > Wireless Networking > Wireless Internet > Looking for software that adds dhcp pcs to a host file

Reply
Thread Tools Display Modes

Looking for software that adds dhcp pcs to a host file

 
 
Chris F Clark
Guest
Posts: n/a

 
      05-20-2007, 05:06 PM
I have a local wirelses/wired lan running behind a soho router that
does dhcp to give my local laptops addresses in the 192.168 space. I
also have a linux server on that lan that I occassionally power on.

I would like a piece of software that goes out and pings the local
address space and finds out what addresses are in use and what
hostnames those addresses are using and makes me a list suitable for
appending to the /etc/hosts file on said server. That seems like
something who is familiar with tcp-ip and networking could write in
about an hour, but would probably take me a day or more to write and I
might do very inefficiently.

Thus, if someone is willing to write said software and send me a copy
in source code I will send them $100. You can keep the software and
re-distribute it however you like as long as I get the rights to keep
and modify my own copy. Note, if you are interested, contact me via
email first, just to make certain I haven't found another author, as I
would hate for you to waste your time and I'm only willing to pay for
one copy of said program (and will pay only after I have verified that
it solves my problem). That will also give us a chance to make
certain we are on the same page as to what the program will do,
i.e. that we have clear acceptance and payment criteria.

Thank you for your interest,
-Chris

************************************************** ***************************
Chris Clark Internet : (E-Mail Removed)
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)
------------------------------------------------------------------------------

 
Reply With Quote
 
 
 
 
Jeff Liebermann
Guest
Posts: n/a

 
      05-20-2007, 06:21 PM
Chris F Clark <(E-Mail Removed)> hath wroth:

>I have a local wirelses/wired lan running behind a soho router that
>does dhcp to give my local laptops addresses in the 192.168 space. I
>also have a linux server on that lan that I occassionally power on.


Ok, so you're looking for Linux based software, not Windoze.

>I would like a piece of software that goes out and pings the local
>address space and finds out what addresses are in use and what
>hostnames those addresses are using and makes me a list suitable for
>appending to the /etc/hosts file on said server.


One piece or can I have it several pieces? What you're looking for is
"networks discovery" type of tools. I could write something like that
using simple shell scripts. Actually, I might have one sitting on one
of my servers from 10+ years ago. I'll check (later). Why you would
want such as an abomination is beyond me. DHCP works well enough.
There are also lots of sites full of Perl and shell scripts that will
probably be close. The hard part will be dealing with duplicate
entries, deleting transient machines, and making it fool proof.

>That seems like
>something who is familiar with tcp-ip and networking could write in
>about an hour, but would probably take me a day or more to write and I
>might do very inefficiently.


It would take me 5 minutes to write it, and the rest of the week to
debug it. I'm a really lousy programmist.

>Thus, if someone is willing to write said software and send me a copy
>in source code I will send them $100. You can keep the software and
>re-distribute it however you like as long as I get the rights to keep
>and modify my own copy. Note, if you are interested, contact me via
>email first, just to make certain I haven't found another author, as I
>would hate for you to waste your time and I'm only willing to pay for
>one copy of said program (and will pay only after I have verified that
>it solves my problem). That will also give us a chance to make
>certain we are on the same page as to what the program will do,
>i.e. that we have clear acceptance and payment criteria.


Hmmm... I'm late for a lavish weekend lunch. I'll see what I can
dredge up later. Meanwhile, I found this Bourne shell script that I
scribbled many years ago called "pingall" which pings everything found
in /etc/hosts which might be useful as part of the routine for
dropping old entries.

MACHINES=`cat /etc/hosts | grep -v "^#" | cut -f2` # get hostnames
for i in $MACHINES
do
echo "testing ${i}...\c"
result=`/usr/bin/ping -c 1 ${i} | grep "bytes from" | \
cut -d " " -f 2-3`
if [ "${result}" = "bytes from" ]
then
echo OK
else
echo BAD
fi
done


Seems to run fine. However, its a weekend so most of office machines
and print serves are turned off:

==> pingall
testing localhost...OK
testing comix.comix.santa-cruz.ca.us...OK
testing pride.comix.santa-cruz.ca.us...BAD
testing avarice.comix.santa-cruz.ca.us...BAD
testing anger.comix.santa-cruz.ca.us...BAD
testing sloth.comix.santa-cruz.ca.us...BAD
testing envy.comix.santa-cruz.ca.us...BAD
testing vectra.comix.santa-cruz.ca.us...BAD
testing glutton.comix.santa-cruz.ca.us...BAD
testing lust.comix.santa-cruz.ca.us...BAD
testing cleanix.comix.santa-cruz.ca.us...OK
testing 810m.comix.santa-cruz.ca.us...BAD
testing atsys1.comix.santa-cruz.ca.us...BAD
testing atsys2.comix.santa-cruz.ca.us...BAD
testing hp5...BAD
testing milan1...BAD
testing milan2...BAD
testing axis1...BAD
testing ps104...BAD
testing 192.168.111.33...OK
testing router...OK


--
Jeff Liebermann (E-Mail Removed)
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558
 
Reply With Quote
 
Chris F Clark
Guest
Posts: n/a

 
      05-20-2007, 11:39 PM
Jeff Liebermann <(E-Mail Removed)> writes:

> One piece or can I have it several pieces?


You can definitely give it to me as several pieces, as long as I
understand how to fit the pieces together.

> What you're looking for is
> "networks discovery" type of tools.


Yes, that seems like a good name for them.

> I could write something like that
> using simple shell scripts. Actually, I might have one sitting on one
> of my servers from 10+ years ago. I'll check (later). Why you would
> want such as an abomination is beyond me. DHCP works well enough.


This is a fair question....

Yes, it does for one thing, but as far as I can tell the soho router
doesn't proved rarp and I want to run dhcp there because it is the
only constant on the lan, since without it, there is no lan. All the
other boxes, including the server in question, I keep it powered down
most of the time. Thus, aside from the router everything else is
transient depending upon what laptops I have brought home on any given
day and what addresses the router assigns them when I hook them in.

Therefore,, I want this software, so when sitting at this server (and
thus have it powered up), I can ssh into one of the laptops I brought
home and copy files off it onto the server. And, I don't want to have
to go to the laptop and ask it what its ip address is, since it might
not be in the same room (or even on the same floor). And, I'd like to
address the laptop by name, as that's how I know which each one is.
They're real creative names like t42p, a30p, sony, hdxpl1040 (that's a
work one and they picked the name) but I know which one each is.

> There are also lots of sites full of Perl and shell scripts that will
> probably be close. The hard part will be dealing with duplicate
> entries, deleting transient machines, and making it fool proof.


Actually, I don't care about perfection. Duplicate entries are
interesting, because some of the laptops have cloned machine names, so
that could be an issue. However, I'm willing to live with a script
the lists the entries that I can them remove dups from. Of course,
nice would be a script that marked dup entries by commenting them out.

> Hmmm... I'm late for a lavish weekend lunch. I'll see what I can
> dredge up later. Meanwhile, I found this Bourne shell script that I
> scribbled many years ago called "pingall" which pings everything found
> in /etc/hosts which might be useful as part of the routine for
> dropping old entries.


That actually, looks like a good start, I just need to revise it to
loop over the address range rather than the name in the hosts file. I
was kind of hoping it would be that easy. Drats, when I tried that it
didn't add the hostname to the ping report, just gave me back the same
address number I typed in.

In fact, that's the part that has me stumped getting the hostname in
the first place. There must be something one can send, that says give
me your hostname. I just don't know what it is....

Thanks,
-Chris

************************************************** ***************************
Chris Clark Internet : (E-Mail Removed)
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)
------------------------------------------------------------------------------
 
Reply With Quote
 
Jeff Liebermann
Guest
Posts: n/a

 
      05-21-2007, 12:25 AM
Chris F Clark <(E-Mail Removed)> hath wroth:

>Yes, it does for one thing, but as far as I can tell the soho router
>doesn't proved rarp and I want to run dhcp there because it is the
>only constant on the lan, since without it, there is no lan. All the
>other boxes, including the server in question, I keep it powered down
>most of the time. Thus, aside from the router everything else is
>transient depending upon what laptops I have brought home on any given
>day and what addresses the router assigns them when I hook them in.
>
>Therefore,, I want this software, so when sitting at this server (and
>thus have it powered up), I can ssh into one of the laptops I brought
>home and copy files off it onto the server. And, I don't want to have
>to go to the laptop and ask it what its ip address is, since it might
>not be in the same room (or even on the same floor). And, I'd like to
>address the laptop by name, as that's how I know which each one is.
>They're real creative names like t42p, a30p, sony, hdxpl1040 (that's a
>work one and they picked the name) but I know which one each is.


If that's all you want, you're doing this all wrong. There's a
feature called "static DHCP" or "Pre-assigned DHCP" found in many
routers. These guarantee that the router will assign the same IP
address to a specific MAC address. You get all the benifits of having
a static IP address for your desktops, with central IP/DHCP
administration in the router. If you need to go to a specific known
desktop, you just point to the IP address.

The only place where this goes wrong is for laptops with an ethernet
port in both the laptop and a docking station, as well as a wireless
device. Each of these has a different MAC address and will have a
corresponding different IP address. Assigning 3 different IP
addresses for a specific laptop has caused me some grief.
Specifically, the pre-assigned DHCP table in most cheap routers is
limited in size and will not handle a large number of machines. For
example, the Dlink DI-624 can only handle 32 entries:
<http://support.dlink.com/Emulators/di624_revE/Home/h_dhcp.html>
If you need more than 32 entries, but still want to leave the power
off on anything that might be used as a DHCP server, then methinks
you're ready for a fancy new router with more features and a high
price tag.

>Actually, I don't care about perfection. Duplicate entries are
>interesting, because some of the laptops have cloned machine names, so
>that could be an issue.


It will be a major issue if the table grows and grows with duplicate
entries every time the script is run. You'll end up with a rather
ugly huge script. The "uniq" command should fix that. Something
like:
echo "localhost 127.0.0.1" > /etc/hosts (wipe hosts file)
cat /etc/hosts.static >> /etc/hosts (restore static IP from file).
sh script.sh | uniq | sort > /etc/hosts (append results of script)

>That actually, looks like a good start, I just need to revise it to
>loop over the address range rather than the name in the hosts file.


Fine. I was gone for a boring lunch. I'll have some time to work on
it later tonite. It's no big deal. However, I suggest you reconsider
doing this as "pre-assigned DHCP" is a much easier way of doing it.

--
Jeff Liebermann (E-Mail Removed)
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558
 
Reply With Quote
 
Al Dykes
Guest
Posts: n/a

 
      05-21-2007, 12:49 AM
In article <(E-Mail Removed)>,
Jeff Liebermann <(E-Mail Removed)> wrote:
>Chris F Clark <(E-Mail Removed)> hath wroth:
>
>>Yes, it does for one thing, but as far as I can tell the soho router
>>doesn't proved rarp and I want to run dhcp there because it is the
>>only constant on the lan, since without it, there is no lan. All the
>>other boxes, including the server in question, I keep it powered down
>>most of the time. Thus, aside from the router everything else is
>>transient depending upon what laptops I have brought home on any given
>>day and what addresses the router assigns them when I hook them in.
>>
>>Therefore,, I want this software, so when sitting at this server (and
>>thus have it powered up), I can ssh into one of the laptops I brought
>>home and copy files off it onto the server. And, I don't want to have
>>to go to the laptop and ask it what its ip address is, since it might
>>not be in the same room (or even on the same floor). And, I'd like to
>>address the laptop by name, as that's how I know which each one is.
>>They're real creative names like t42p, a30p, sony, hdxpl1040 (that's a
>>work one and they picked the name) but I know which one each is.

>
>If that's all you want, you're doing this all wrong. There's a
>feature called "static DHCP" or "Pre-assigned DHCP" found in many
>routers. These guarantee that the router will assign the same IP
>address to a specific MAC address. You get all the benifits of having
>a static IP address for your desktops, with central IP/DHCP
>administration in the router. If you need to go to a specific known
>desktop, you just point to the IP address.
>
>The only place where this goes wrong is for laptops with an ethernet
>port in both the laptop and a docking station, as well as a wireless
>device. Each of these has a different MAC address and will have a



I bet $100 would buy the OP a router/broadband box that was smart
enough to have a table that assigned specific IP addresses by MAC
address each time a machine renewed a lease.

What about setting the expiration to "never". Can aby small boxes do
that? You would have, effectively, a static IP for each MAC.

Do one of the above and then you can have a static host file on each
machine to map IP to names.



The OP can use IPCop or m0n0 (both free) on an old PC to replace the
broadband box and provide more capability, including a full function
firewall, dhcp and dns servers that will do anything he wants to do.

An old laptop would be fine for IPCop/m0no. The dead battery would be
a sufficient UPS and the electric bill would be about $10/month
cheaper than running an old desktop system.

http://m0n0.ch/wall/
http://ipcop.org/

--
a d y k e s @ p a n i x . c o m
Don't blame me. I voted for Gore. A Proud signature since 2001
 
Reply With Quote
 
Chris F Clark
Guest
Posts: n/a

 
      05-21-2007, 03:21 AM
Ok, I'll look into "static dhcp". The router I'm using is a linksys
wrt54g. The laptops have the 3 address problem, but there are only 5
of them plus the 2 desktops (one with 2 ethernet cards), so as long as
I get 32 addresses I should have enough.

Thanks, for the suggestion. Next weekend, I'll try it. If it works,
I'll still send you an expression of my gratitude, since it still will
have saved me some effort....

 
Reply With Quote
 
Chris F Clark
Guest
Posts: n/a

 
      05-21-2007, 03:54 AM
(E-Mail Removed) (Al Dykes) writes:

> The OP can use IPCop or m0n0 (both free) on an old PC to replace the
> broadband box and provide more capability, including a full function
> firewall, dhcp and dns servers that will do anything he wants to do.
>
> An old laptop would be fine for IPCop/m0no. The dead battery would be
> a sufficient UPS and the electric bill would be about $10/month
> cheaper than running an old desktop system.


I can understand how to use ipcop as a firewall, but how do I fit it
"inside" my lan. Most of my laptops are wireless, so I need the
wireless router. If I put the ipcop system between the router and the
modem, then doesn't the NAT in the router get in the way. If I put it
inside the lan, it can't be a firewall can it? Although, then, it
could do the dhcp and dns. However, if I do that, it seems I might as
just well have the server I'm not powering up do the dhcp and dns,
which is actually something I'd like to avoid, since the fewer boxes
in the solution, the fewer points of failure there are.
 
Reply With Quote
 
Jeff Liebermann
Guest
Posts: n/a

 
      05-21-2007, 06:21 AM
Chris F Clark <(E-Mail Removed)> hath wroth:

>Ok, I'll look into "static dhcp". The router I'm using is a linksys
>wrt54g.


The stock WRT54G firmware does NOT have a "static DHCP" feature.

If you install DD-WRT v23 SP2 or other alternative firmware on your
WRT54G, you'll have this feature (along with a huge collection of
other nifty features). See:
<http://www.dd-wrt.com/wiki/index.php?title=Static_DHCP>
<http://www.wi-fiplanet.com/tutorials/article.php/3624251>
Also OpenWRT:
<http://martybugs.net/wireless/openwrt/dnsmasq.cgi>
which is less menu driven and more config file editing based.

One gotcha is that the WRT54G v5 and v6 hardware mutations are not the
best firmeware transplant candidates on the planet. It's also
somewhat of an ordeal to install on these versions. It's worth a try,
but if you have a deadline or mission critical, downtime sensitive, or
cannot fail installation, I suggest you simply purchase a better cheap
router, such as a Buffalo WHR-HP-G54 or WHR-G54S.

>The laptops have the 3 address problem, but there are only 5
>of them plus the 2 desktops (one with 2 ethernet cards), so as long as
>I get 32 addresses I should have enough.


The size of the MAC address table can be expanded with compile time
options. If you've never tried to compile DD-WRT or OpenWRT, you'll
probably find it rather difficult. There are people available that
will do it for you, but I don't think it will be necessary.

>Thanks, for the suggestion. Next weekend, I'll try it. If it works,
>I'll still send you an expression of my gratitude, since it still will
>have saved me some effort....


Thanks, but no cash or goodies required (unless they're geek toys).
However, I'm probably going to pass on doing any more shell scripting
(because I'm a terrible programmer and am lazy). Incidentally, the I
wrote the shell script 15 years ago for SCO Unix 3.2v4.2, which has
some substantial differences in program location and output from the
current Linux LSB (Linux Standards Base) 3.0/3.1. I just tried to run
it on my W2K machine using Cygwin, which produced problems similar to
what you've experienced. I'm too lazy to fix it tonite.

Good luck...

--
Jeff Liebermann (E-Mail Removed)
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Host File for ME???? Daniel Bohner Windows Networking 11 07-07-2004 12:21 PM
Host software for win2k remote desktop Randy Windows Networking 3 02-18-2004 02:51 AM
Win 98 host file Antoine Smith Windows Networking 3 02-01-2004 02:09 AM
Windows 2k Server with RRAS - wan IP adds itself to DNS as host User Windows Networking 1 11-27-2003 12:34 AM
Host file Rob Gates Windows Networking 0 09-10-2003 12:26 PM



1 2 3 4 5 6 7 8 9 10 11