Logging MAC of all machines on my network
up vote
0
down vote
favorite
I would like to know what machines connect to my home network. My thought was to have a MySQL database with an entry for each machine, with the timestamp of when I saw it last, and a tally of how many times I have seen it. That is straightforward. My queston is how do I scan for the MACs? I have considered something like this running every 30 minutes:
#! /usr/bin/python
import nmap
nm = nmap.PortScanner()
nm.scan(hosts='10.10.10.0/24', arguments='-n -sP -PE)
hosts_list = [(x, nm[x]['status']['state']) for x in nm.all_hosts()]
for host, status, mac in hosts_list:
save(host,status,mac)
... but in order to get the MAC, I need to run this as root
.
- Is there a better way of doing this? (I have considered also if I could get the DHCP records from the router, but that would not find any fixed-ip devices)
- Could I use another tool?
- Is there any security measure i can take running a script in cron as root?
networking cron mac-address network-discovery
add a comment |
up vote
0
down vote
favorite
I would like to know what machines connect to my home network. My thought was to have a MySQL database with an entry for each machine, with the timestamp of when I saw it last, and a tally of how many times I have seen it. That is straightforward. My queston is how do I scan for the MACs? I have considered something like this running every 30 minutes:
#! /usr/bin/python
import nmap
nm = nmap.PortScanner()
nm.scan(hosts='10.10.10.0/24', arguments='-n -sP -PE)
hosts_list = [(x, nm[x]['status']['state']) for x in nm.all_hosts()]
for host, status, mac in hosts_list:
save(host,status,mac)
... but in order to get the MAC, I need to run this as root
.
- Is there a better way of doing this? (I have considered also if I could get the DHCP records from the router, but that would not find any fixed-ip devices)
- Could I use another tool?
- Is there any security measure i can take running a script in cron as root?
networking cron mac-address network-discovery
3
Use arpwatch.
– Ipor Sircer
Nov 29 at 14:24
arpwatch looks like the proper solution. @IporSircer will you post an answer, so I can accept it?
– Jonas Stumph Stevnsvig
Nov 30 at 8:38
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I would like to know what machines connect to my home network. My thought was to have a MySQL database with an entry for each machine, with the timestamp of when I saw it last, and a tally of how many times I have seen it. That is straightforward. My queston is how do I scan for the MACs? I have considered something like this running every 30 minutes:
#! /usr/bin/python
import nmap
nm = nmap.PortScanner()
nm.scan(hosts='10.10.10.0/24', arguments='-n -sP -PE)
hosts_list = [(x, nm[x]['status']['state']) for x in nm.all_hosts()]
for host, status, mac in hosts_list:
save(host,status,mac)
... but in order to get the MAC, I need to run this as root
.
- Is there a better way of doing this? (I have considered also if I could get the DHCP records from the router, but that would not find any fixed-ip devices)
- Could I use another tool?
- Is there any security measure i can take running a script in cron as root?
networking cron mac-address network-discovery
I would like to know what machines connect to my home network. My thought was to have a MySQL database with an entry for each machine, with the timestamp of when I saw it last, and a tally of how many times I have seen it. That is straightforward. My queston is how do I scan for the MACs? I have considered something like this running every 30 minutes:
#! /usr/bin/python
import nmap
nm = nmap.PortScanner()
nm.scan(hosts='10.10.10.0/24', arguments='-n -sP -PE)
hosts_list = [(x, nm[x]['status']['state']) for x in nm.all_hosts()]
for host, status, mac in hosts_list:
save(host,status,mac)
... but in order to get the MAC, I need to run this as root
.
- Is there a better way of doing this? (I have considered also if I could get the DHCP records from the router, but that would not find any fixed-ip devices)
- Could I use another tool?
- Is there any security measure i can take running a script in cron as root?
networking cron mac-address network-discovery
networking cron mac-address network-discovery
asked Nov 29 at 14:22
Jonas Stumph Stevnsvig
1507
1507
3
Use arpwatch.
– Ipor Sircer
Nov 29 at 14:24
arpwatch looks like the proper solution. @IporSircer will you post an answer, so I can accept it?
– Jonas Stumph Stevnsvig
Nov 30 at 8:38
add a comment |
3
Use arpwatch.
– Ipor Sircer
Nov 29 at 14:24
arpwatch looks like the proper solution. @IporSircer will you post an answer, so I can accept it?
– Jonas Stumph Stevnsvig
Nov 30 at 8:38
3
3
Use arpwatch.
– Ipor Sircer
Nov 29 at 14:24
Use arpwatch.
– Ipor Sircer
Nov 29 at 14:24
arpwatch looks like the proper solution. @IporSircer will you post an answer, so I can accept it?
– Jonas Stumph Stevnsvig
Nov 30 at 8:38
arpwatch looks like the proper solution. @IporSircer will you post an answer, so I can accept it?
– Jonas Stumph Stevnsvig
Nov 30 at 8:38
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
From a Windows command line: arp -a
will give you the IP and MAC address of every system currently on your network.
ARP table entries do time out.
– Ron Maupin
Nov 29 at 15:28
Which is why you check them often, and check them on the router (not some random PC). It's still more reliable than ping scans. (Although it would be most reliable to directly log the ARP messages themselves.)
– grawity
Nov 30 at 5:34
add a comment |
up vote
-3
down vote
Please try to check the following threads,
https://askubuntu.com/questions/406792/list-all-mac-addresses-and-their-associated-ip-addresses-in-my-local-network-la
https://www.itprotoday.com/cloud-computing/how-can-i-get-list-mac-ip-addresses-network
I am not just after the list. My code is running nmap, through an api/wrapper.
– Jonas Stumph Stevnsvig
Nov 30 at 12:38
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
From a Windows command line: arp -a
will give you the IP and MAC address of every system currently on your network.
ARP table entries do time out.
– Ron Maupin
Nov 29 at 15:28
Which is why you check them often, and check them on the router (not some random PC). It's still more reliable than ping scans. (Although it would be most reliable to directly log the ARP messages themselves.)
– grawity
Nov 30 at 5:34
add a comment |
up vote
1
down vote
From a Windows command line: arp -a
will give you the IP and MAC address of every system currently on your network.
ARP table entries do time out.
– Ron Maupin
Nov 29 at 15:28
Which is why you check them often, and check them on the router (not some random PC). It's still more reliable than ping scans. (Although it would be most reliable to directly log the ARP messages themselves.)
– grawity
Nov 30 at 5:34
add a comment |
up vote
1
down vote
up vote
1
down vote
From a Windows command line: arp -a
will give you the IP and MAC address of every system currently on your network.
From a Windows command line: arp -a
will give you the IP and MAC address of every system currently on your network.
answered Nov 29 at 15:22
James Deal
111
111
ARP table entries do time out.
– Ron Maupin
Nov 29 at 15:28
Which is why you check them often, and check them on the router (not some random PC). It's still more reliable than ping scans. (Although it would be most reliable to directly log the ARP messages themselves.)
– grawity
Nov 30 at 5:34
add a comment |
ARP table entries do time out.
– Ron Maupin
Nov 29 at 15:28
Which is why you check them often, and check them on the router (not some random PC). It's still more reliable than ping scans. (Although it would be most reliable to directly log the ARP messages themselves.)
– grawity
Nov 30 at 5:34
ARP table entries do time out.
– Ron Maupin
Nov 29 at 15:28
ARP table entries do time out.
– Ron Maupin
Nov 29 at 15:28
Which is why you check them often, and check them on the router (not some random PC). It's still more reliable than ping scans. (Although it would be most reliable to directly log the ARP messages themselves.)
– grawity
Nov 30 at 5:34
Which is why you check them often, and check them on the router (not some random PC). It's still more reliable than ping scans. (Although it would be most reliable to directly log the ARP messages themselves.)
– grawity
Nov 30 at 5:34
add a comment |
up vote
-3
down vote
Please try to check the following threads,
https://askubuntu.com/questions/406792/list-all-mac-addresses-and-their-associated-ip-addresses-in-my-local-network-la
https://www.itprotoday.com/cloud-computing/how-can-i-get-list-mac-ip-addresses-network
I am not just after the list. My code is running nmap, through an api/wrapper.
– Jonas Stumph Stevnsvig
Nov 30 at 12:38
add a comment |
up vote
-3
down vote
Please try to check the following threads,
https://askubuntu.com/questions/406792/list-all-mac-addresses-and-their-associated-ip-addresses-in-my-local-network-la
https://www.itprotoday.com/cloud-computing/how-can-i-get-list-mac-ip-addresses-network
I am not just after the list. My code is running nmap, through an api/wrapper.
– Jonas Stumph Stevnsvig
Nov 30 at 12:38
add a comment |
up vote
-3
down vote
up vote
-3
down vote
Please try to check the following threads,
https://askubuntu.com/questions/406792/list-all-mac-addresses-and-their-associated-ip-addresses-in-my-local-network-la
https://www.itprotoday.com/cloud-computing/how-can-i-get-list-mac-ip-addresses-network
Please try to check the following threads,
https://askubuntu.com/questions/406792/list-all-mac-addresses-and-their-associated-ip-addresses-in-my-local-network-la
https://www.itprotoday.com/cloud-computing/how-can-i-get-list-mac-ip-addresses-network
answered Nov 30 at 12:24
Mick
151
151
I am not just after the list. My code is running nmap, through an api/wrapper.
– Jonas Stumph Stevnsvig
Nov 30 at 12:38
add a comment |
I am not just after the list. My code is running nmap, through an api/wrapper.
– Jonas Stumph Stevnsvig
Nov 30 at 12:38
I am not just after the list. My code is running nmap, through an api/wrapper.
– Jonas Stumph Stevnsvig
Nov 30 at 12:38
I am not just after the list. My code is running nmap, through an api/wrapper.
– Jonas Stumph Stevnsvig
Nov 30 at 12:38
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1379432%2flogging-mac-of-all-machines-on-my-network%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
Use arpwatch.
– Ipor Sircer
Nov 29 at 14:24
arpwatch looks like the proper solution. @IporSircer will you post an answer, so I can accept it?
– Jonas Stumph Stevnsvig
Nov 30 at 8:38