DHCP server discover | Unix Linux Forums | IP Networking

  Go Back    


IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

DHCP server discover

IP Networking


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-14-2011
getrue getrue is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 25 November 2013, 2:01 PM EST
Posts: 105
Thanks: 13
Thanked 9 Times in 9 Posts
DHCP server discover

I need a script to scan the surrounding DHCP servers. I want to know how many dhcp servers are there on my connected etnernet.
Sponsored Links
    #2  
Old 11-14-2011
otheus's Avatar
otheus otheus is offline Forum Advisor  
Smartass
 
Join Date: Feb 2007
Last Activity: 24 February 2014, 8:14 AM EST
Location: Innsbruck, Austria
Posts: 2,143
Thanks: 12
Thanked 47 Times in 44 Posts
Mrm. A script won't help you. Something like nmap would be your tool of choice. I'm thinking this is what you want to use (run as root):

Code:
nmap -oN /tmp/dhcp-discovery.txt -sU -p 67,547 10.2.11.0/24  10.2.0.0/16

Change the portion in blue to match your subnet/bits-in-mask.

Then grep the results:

Code:
grep -B4 open /tmp/dhcp-discovery.txt

If your grep doesn't support "-B", try:

Code:
egrep "(^Interesting)|( open)" /tmp/dhcp-discovery

And you'll see output like:

Code:
Interesting ports on 10.2.11.88:
Interesting ports on 10.2.11.205:
67/udp open|filtered dhcps
Interesting ports on 10.2.11.210:
Interesting ports on 10.2.11.211:
Interesting ports on 10.2.11.212:

And the line in red is the one you're interested in.

Last edited by otheus; 11-14-2011 at 09:18 AM.. Reason: corrections, expounding on output
Sponsored Links
    #3  
Old 11-17-2011
getrue getrue is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 25 November 2013, 2:01 PM EST
Posts: 105
Thanks: 13
Thanked 9 Times in 9 Posts
Thanks dud, I have tried your recommendation. I got a lot of ip addresses on my network as result. I didn't understand that which one is dhcp offer,discover or inform packages. It only shown dhcp open or closed. I'm just looking for the ip address that the dhcp packages are offered. only offered packages not discover or inform packages.

I found script that is searching dhcp offer packages. DHCP offer packages mean DHCP server.


Script is on related link. roguedetector - Revision 29: /trunk/RogueDetect It have dependency : libconfig, libnet, libnet-devel, libpcap. You can read README file.

Wireshark is searching DHCP offer, discover and inform packages. We must write bootp on filter box.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
DHCP Server address cokedude Red Hat 6 06-09-2011 01:40 AM
couldn't contact the DHCP server srikanthg Solaris 1 02-16-2009 10:16 AM
AIX & DHCP Server ektoplasma2000 AIX 0 10-30-2006 03:11 AM
DHCP server question chanfle IP Networking 5 03-20-2006 09:53 AM
DHCP Server Suggestions coreyhead UNIX for Dummies Questions & Answers 2 07-12-2001 01:15 PM



All times are GMT -4. The time now is 03:04 AM.