From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QPfs2-0001Zf-Jk for garchives@archives.gentoo.org; Thu, 26 May 2011 19:05:22 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8DD9D1C1CA; Thu, 26 May 2011 19:03:59 +0000 (UTC) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 064D91C1CA for ; Thu, 26 May 2011 19:03:58 +0000 (UTC) Received: by wyi11 with SMTP id 11so1007062wyi.40 for ; Thu, 26 May 2011 12:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:reply-to:to:subject:date:user-agent :references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=SFWb4fhSxSR7dyc1/oXl4WfCQMslibT/acdSpXjoNYA=; b=vH+tY6n9Jir2lkJymtzrzesMRwZWkkQGF25BfDAz9mvmozqj7zGxM/msS68UyJrFbh 4tRGmkN6ZyvMwK+jBnw3+ye/7oWSf8RydbLXPvODUi5Jc27AwFXYYDK3XKVtmSEHAfHI /ciG/6DsEa0dqv2MZcjNluqEjNpSdAaICa6qU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=qc4ktUPeoRV5Xzia4r98xxIS/AxDqeJcdCp1r/8sbfk2FgpIA/tu17TRJ42huBwrSV Vn6FTJbWmjJ7fRYZdSk/tNu/hdaYkIy1+nYxdylGMQLReQQRhkh4WdNnG3FBg2C/VPfD Yu0uhPeA/xg4BjObtBEPKWMv0fzn7ckmDHa/Q= Received: by 10.227.9.131 with SMTP id l3mr1267687wbl.54.1306436638249; Thu, 26 May 2011 12:03:58 -0700 (PDT) Received: from dell_xps.localnet (230.3.169.217.in-addr.arpa [217.169.3.230]) by mx.google.com with ESMTPS id fw15sm676685wbb.61.2011.05.26.12.03.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2011 12:03:57 -0700 (PDT) From: Mick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] [OT] network discovery tools Date: Thu, 26 May 2011 20:04:33 +0100 User-Agent: KMail/1.13.7 (Linux/2.6.37-gentoo-r4; KDE/4.6.2; x86_64; ; ) References: <871uzmwon0.fsf@newsguy.com> <4DDE7EA5.7090206@binarywings.net> In-Reply-To: <4DDE7EA5.7090206@binarywings.net> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3555083.6Clmc7a2MQ"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201105262004.34740.michaelkintzios@gmail.com> X-Archives-Salt: X-Archives-Hash: 3297ec90a2c644b3e2eefe48a3485d8c --nextPart3555083.6Clmc7a2MQ Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thursday 26 May 2011 17:24:05 Florian Philipp wrote: > Am 25.05.2011 21:45, schrieb Harry Putnam: > > There must be a number of people who post here that have had to do > > this problem. > >=20 > > Discover the addresses of computers on a home network that have > > connected by way of DHCP. For example: Several wireless connections. > >=20 > > I've used static IPS for around 10 yrs, always seemed handier for > > things like ssh between home lan computers. > >=20 > > But recently started using DHCP for wireless connections. It must be > > such a popular method for some reason. > >=20 > > But when you do it that way, and say want to VNC or ssh or the like to > > something connected by a dhcp serving WAP then how do you find the > > address? > >=20 > > That is, besides something like accessing the WAP and checking the IPs > > connected to it. > >=20 > > Is there some quick and sure way to discover any IPs on the home lan? > >=20 > > Some kind of mapper tool? >=20 > While I personally prefer a combined DHCP+DNS server like dnsmasq, you > can also take a look at the whole Zeroconf/MDNS/Avahi/Bonjour stack. >=20 > I'm not really sure if you can configure common devices and Linux PCs to > use the DNS server for internet addresses and MDNS for local ones. In > theory, it should be possible since you can distinguish them (local > addresses should not be fully qualified _or_ have the domain .local). >=20 > net-misc/mDNSResponder, sys-auth/nss-mdns and net-dns/avahi are probably > good starting points. netdiscover seems to do exactly what the OP asked for, although I have used= =20 arping and a couple of scripts I found on the net and modified them. The first looks like this: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D #!/usr/bin/env bash quit_on_found=3D0 packet_count=3D2 subnet=3D"" verbose=3D"-q" usage() { cat << EOF find_ip 1.0 Robin Wood (dninja@gmail.com) (www.digininja.org) =46ind used and unused IPs on a network you don't haven an IP address on usage: $0 options OPTIONS: -h Show this message -c The number of ping packets to send, default 2 -s First 3 parts of the subnet to test, default=20 192.168.0 -q Quit when found first free address, default keep= =20 going -v Verbose EOF } have_arping=3D`which arping` if [[ "$have_arping" =3D=3D "" ]] then cat << EOF usage: $0 options You must have arping installed and in the current path for this scanner to= =20 work EOF exit 1 fi while getopts ":hvs:qc:" flag do case $flag in h) usage exit 1 ;; c) packet_count=3D$OPTARG ;; q) quit_on_found=3D1 ;; s) subnet=3D$OPTARG ;; v) verbose=3D"" ;; ?) usage exit 1 ;; esac done if [[ "$subnet" =3D=3D "" ]] then cat << EOF usage: $0 options You must provide a subnet EOF exit 1 fi if [[ "$verbose" =3D=3D "" ]] then if [[ $quit_on_found =3D=3D 1 ]] then echo "Quiting when found a free address" fi echo "Testing subnet $subnet.0/24" echo "Sending $packet_count packets per IP" fi for i in {1..254} do IP=3D$subnet.$i arping $verbose -c $packet_count $IP result=3D$? if [[ $result =3D=3D 0 ]] then echo "$IP Used" else echo "$IP Free" if [[ $quit_on_found =3D=3D 1 ]] then exit fi fi done =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D Google for "find_ip.sh" The other which I can't find at the moment prints out the MAC address of ea= ch=20 IP address that is in use. Alternatively, run the above script with the -v= =20 option and then scroll back to look at the MAC addresses. Of course, I was using this before I knew that netdiscover existed - thanks= =20 for sharing! =2D-=20 Regards, Mick --nextPart3555083.6Clmc7a2MQ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iEYEABECAAYFAk3epEIACgkQVTDTR3kpaLazZgCgpXPQDPYJfCHMNTKLaQBqUfKY UN4AoMG1rR5A0BsP+x51tvnfuRhdzDeu =YAHf -----END PGP SIGNATURE----- --nextPart3555083.6Clmc7a2MQ--