Networking Forums

Networking Forums > Computer Networking > Linux Networking > programmatically know who's connected to a router

Reply
Thread Tools Display Modes

programmatically know who's connected to a router

 
 
michiedo@email.it
Guest
Posts: n/a

 
      02-03-2009, 08:11 AM
is there a way to programmatically know who's connected to my router
?
either wireless or by cable
either via DHCP or with static address ?
there should be, because on my router (netgear) there is a page that
shows "connected devices" ...
i've googled without success
Thank you for any hint
 
Reply With Quote
 
 
 
 
David Schwartz
Guest
Posts: n/a

 
      02-03-2009, 08:34 AM
On Feb 3, 1:11*am, michi...@email.it wrote:
> is there a way to programmatically know who's connected to my router
> ?
> either wireless or by cable
> either via DHCP or with static address ?
> there should be, because on my router (netgear) there is a page that
> shows "connected devices" ...
> i've googled without success
> Thank you for any hint


Simply precisely define what you mean by "connected", and check for
that. Presumably, your DHCP server has a database of assigned
addresses somewhere. It's not clear what it would mean for something
to be "connected" to your router with a static address. So I don't
think it makes any sense to check for that.

Linux does keep track of pseudo-connections that can be created by any
packet passing through the computer and kept around for some time.
This may be the information you actually want -- history of recent
packets passing through your router. Punch 'linux connection tracking'
into your favorite search engine.

DS
 
Reply With Quote
 
Rikishi42
Guest
Posts: n/a

 
      02-03-2009, 11:13 PM
On 2009-02-03, (E-Mail Removed) <(E-Mail Removed)> wrote:
> is there a way to programmatically know who's connected to my router
> ?
> either wireless or by cable
> either via DHCP or with static address ?
> there should be, because on my router (netgear) there is a page that
> shows "connected devices" ...
> i've googled without success


Connected to the router means very little.
I'm going to asssume you mean "Who's in my router's network?".

Look into nmap.

Start with nmap 192.168.0.* (assuming that would be your network).

--
Elevators smell different to midgets
 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      02-04-2009, 12:03 AM
(E-Mail Removed) wrote:
> is there a way to programmatically know who's connected to my router
> ?
> ...
> there should be, because on my router (netgear) there is a page that
> shows "connected devices" ...


All that means is there is a way to get that information from a
program running on the netgear itself. It does not imply there is
some API you could use on another system to reach-out and ask the
netgear - short of a program mimicing what you are doing when browsing
the netgear's web interface.

rick jones
--
firebug n, the idiot who tosses a lit cigarette out his car window
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
 
michiedo@email.it
Guest
Posts: n/a

 
      02-04-2009, 06:45 AM
First of all: sincere thanks to all who spent their time answering my
question, i really appreciate.
Simplyfing (cutting down?) my question:
i'm trying to discover if someone is connecting wireless to my home
network that is unprotected.
I've tried to implement WPA, but on the windows PCs it causes
performance degradation and random disconnects, and on linux (ubuntu)
i didn't succeed at all to get connected, so i gave up :-(
Now i think the best solution (workaround) is nmap, simply scanning
the addresses that are in my router (netgear DG834Gv3) dhcp range.
 
Reply With Quote
 
Dan C
Guest
Posts: n/a

 
      02-04-2009, 12:48 PM
On Tue, 03 Feb 2009 23:45:18 -0800, michiedo wrote:

> First of all: sincere thanks to all who spent their time answering my
> question, i really appreciate.
> Simplyfing (cutting down?) my question: i'm trying to discover if
> someone is connecting wireless to my home network that is unprotected.
> I've tried to implement WPA, but on the windows PCs it causes
> performance degradation and random disconnects, and on linux (ubuntu) i
> didn't succeed at all to get connected, so i gave up :-( Now i think the
> best solution (workaround) is nmap, simply scanning the addresses that
> are in my router (netgear DG834Gv3) dhcp range.


No, the "best solution" is to figure out why you are unable to use WPA.
It isn't difficult, and it should not degrade performance to any
noticeable degree. Spend your time solving the problem, not searching
for a bandaid to put on it.


--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
The Usenet Improvement Project: http://improve-usenet.org
Ahhhhhhh!: http://brandybuck.site40.net/pics/relieve.jpg
 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      02-09-2009, 11:43 AM
Hello,

Andrew Gideon a écrit :
>
> More importantly: nmap might not catch well-firewalled devices.


One might have better luck doing an ARP scan for each possible IP
address in the subnet, e.g. using arping in a loop. Even a node dropping
any unexpected incoming IP packet should reply to an ARP query in order
to be able to receive IP packets. However in order to better hide itself
a node may reply only to ARP queries coming from nodes (local router or
host) frow which it expects IP traffic. In this case, the best you can
do is watch ARP queries from these nodes which need to learn the MAC
address of the hidden host in order to deliver return traffic to it.
This may be done with tools such as arpwatch. Of course this won't work
if the hidden node only listens to traffic passively.
 
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
How to programmatically ban specific IP addresses Mike via WinServerKB.com Windows Networking 1 06-12-2008 03:51 AM
How to turn om/off 802.11 adapter programmatically Arsalan Ahmad Wireless Networks 5 05-12-2006 04:15 PM
How to add DNS addresses programmatically ? =?Utf-8?B?cm9vZnJhY2s=?= Windows Networking 0 11-29-2004 09:19 PM
how to programmatically get subnetmask Vinod Kumar P Windows Networking 1 11-01-2003 08:57 PM
how to programmatically get subnetmask Vinod Kumar P Linux Networking 1 11-01-2003 03:06 PM



1 2 3 4 5 6 7 8 9 10 11