Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-13-2010, 08:17 PM
|
#1
|
|
LQ Newbie
Registered: May 2009
Posts: 8
Rep:
|
Difference between ARP and iwgetid -ar MAC addresses?
Hello there -
I wrote up a script to do an automatic "phone home" from my laptop, in case it was stolen. It runs in the background, pinging a remote server every couple minutes with info. (The server-side script logs the IP as well).
One of the pieces of info sent on the URL is the MAC address of the wireless router connected to (if any).
I'm curious about the different MAC addresses I see for the wireless router... I'm obviously no networking expert. :-)
[Note: the center four hex pairs have been changed to 11:22:33:44 in these examples; the others are accurate.]
Code:
$ iwgetid -a eth1
eth1 Access Point/Cell: 02:11:22:33:44:55
[same MAC that shows up in iwlist eth1 scan...]
But:
Code:
$ arp
Address HWtype HWaddress Flags Mask Iface
192.168.1.1 ether 00:11:22:33:44:52 C eth1
...is either of these MAC addresses more or less "accurate"?
In the config screen for the router itself (running dd_wrt), it shows:
Code:
LAN MAC
00:11:22:33:44:52
WAN MAC
00:11:22:33:44:54
Wireless MAC
00:11:22:33:44:54
...which agree more with arp.
I'm happy to chalk this up to "weird interface between dd_wrt and the router and arp and iwgetid", i'd just like to know that i'm not making any dumb mistakes (especially because the windows version i made is using the windows arp command to extract the same info...)
Thanks!
-C
Last edited by chconnor; 04-13-2010 at 08:37 PM.
|
|
|
|
04-13-2010, 08:35 PM
|
#2
|
|
LQ Newbie
Registered: May 2009
Posts: 8
Original Poster
Rep:
|
More info...
Ah, so. Logged into the router and did "ifconfig"; among the various interfaces listed I can see all the MAC addresses discovered via the above techniques... good to know that there's nothing too buggy about what i'm doing, but i'd still appreciate any advice as to which is "best".
Thanks,
-c
|
|
|
|
04-14-2010, 03:23 AM
|
#3
|
|
Member
Registered: Mar 2009
Posts: 245
Rep:
|
They answer different questions. What are you trying to find the MAC address of?
|
|
|
|
04-15-2010, 01:22 PM
|
#4
|
|
LQ Newbie
Registered: May 2009
Posts: 8
Original Poster
Rep:
|
Thanks for the reply - I suppose what I'm most interested in is whichever would be useful if the laptop were ever stolen. In this case I suppose that would be whatever MAC address is easiest/most reliably confirmable as being associated with a particular router.
|
|
|
|
04-16-2010, 04:55 AM
|
#5
|
|
Member
Registered: Mar 2009
Posts: 245
Rep:
|
The MAC address of the router (unless it's also access point) is not useful for finding the laptop as one won't be able relate that to any owner or a location. Nor do I think it will stand up in court.
I suggest the BSSID (MAC address) and SSID (network name) of all access points within range, the MAC address of the laptop, IP addresses assigned to the laptop, public IP addresses and port numbers, that's both IPv4 and IPv6.
|
|
|
|
04-16-2010, 03:22 PM
|
#6
|
|
LQ Newbie
Registered: May 2009
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by TimothyEBaldwin
The MAC address of the router (unless it's also access point) is not useful for finding the laptop as one won't be able relate that to any owner or a location. Nor do I think it will stand up in court.
I suggest the BSSID (MAC address) and SSID (network name) of all access points within range, the MAC address of the laptop, IP addresses assigned to the laptop, public IP addresses and port numbers, that's both IPv4 and IPv6.
|
Thanks, yeah, i was looking for the MAC of the router for the second reason: in case it was useful to confirm in some theoretical court where the person was, what they were connected to, etc; not for tracking down the location. So in terms of that, is there a preference between the "arp" MAC or the "iwgetid" MAC?
I am already gathering the all the MACs/SSIDs of the local access points, thanks. The laptop's MAC auto-changes on startup, so it's not useful. I thought about gathering the laptop's assigned IP, but decided it wouldn't be useful? Would it?
The server-side script notes the IP and any proxy IP of the hit to the page. Is there some other IP (v4 or 6) that qualifies as "public"? Perhaps you're talking about other IPs on the LAN?
Thanks a lot!
-c
|
|
|
|
04-16-2010, 06:47 PM
|
#7
|
|
Member
Registered: Mar 2009
Posts: 245
Rep:
|
You seem to assume that the access point and the router are the same device, this isn't always the case; there may also be more than one router.
The "arp" command does not distinguish between hosts and routers, but this is unneeded. "ip neigh show" will show IPv6 information as well.
Therefore use "iwgetid -a" and "ip neigh show"
|
|
|
|
04-17-2010, 02:21 AM
|
#8
|
|
LQ Newbie
Registered: May 2009
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by TimothyEBaldwin
You seem to assume that the access point and the router are the same device, this isn't always the case
|
Ah, indeed i had forgotten that distinction, thanks.
Quote:
The "arp" command does not distinguish between hosts and routers, but this is unneeded. "ip neigh show" will show IPv6 information as well.
Therefore use "iwgetid -a" and "ip neigh show"
|
Thanks, will do. Appreciated,
-c
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:51 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|