Questions tagged [mac-address]

A Media Access Control address (MAC address) is a unique identifier assigned to network interfaces for communications on the physical network segment.

A MAC address is a 48 bit identifier assigned to every device connected to a network. They are normally written as 6 octets displayed as hexadecimal digits, for example 08:01:27:0E:25:B8. The first 3 octets identify the manufacturer, the last 3 are to ensure that each address for that manufacturer is unique.

MAC addresses are used for numerous network technologies and most IEEE 802 network technologies, including Ethernet. Logically, MAC addresses are used in the Media Access Control protocol sub-layer of the OSI reference model.

1056 questions
27
votes
9 answers

Get MAC address on local machine with Java

I can use ip = InetAddress.getLocalHost(); NetworkInterface.getByInetAddress(ip); to obtain the mac address, but if I use this code in an offline machine it doesn't work. So, How can I get the Mac address?
Jevivre xavie
  • 303
  • 1
  • 4
  • 11
25
votes
8 answers

Obtain MAC Address from Devices using Python

I'm looking for a way (with python) to obtain the layer II address from a device on my local network. Layer III addresses are known. The goal is to build a script that will poll a databases of IP addresses on regular intervals ensuring that the mac…
nfarrar
  • 2,291
  • 4
  • 25
  • 33
24
votes
2 answers

How to get a remote MAC address via IPv6 in iOS programmatically

I need to find a solution how to get the MAC address from the other device in the WiFi network. There is a good method how to do this for IPv4 (How does iOS app Fing get MAC Address?), but how to do this for IPv6? Since ARP was replaced by the NDP…
Max Niagolov
  • 684
  • 9
  • 26
23
votes
5 answers

Get MAC Address of android device without Wifi

How do I get the MAC-Address of the network interface of an android device which doesn't have a Wifi-Interface (e.g. the android emulator)? WifiInfo obtained via the WifiManager returns null. EDIT To be more clear: I have to communicate with an…
Tom
  • 5,068
  • 5
  • 29
  • 41
21
votes
5 answers

How to determine MAC Address of the actual physical network card -- not virtual network interfaces created by VPN's (.NET C#)

Background I'm trying to get obtain a unique identifier out of a computer and want to be able to reliably return the same MAC address each time. Trust me I have my reasons for using MAC address and have read many posts about alternate unique id…
blak3r
  • 16,066
  • 16
  • 78
  • 98
19
votes
3 answers

Can't spoof MAC address in a MacBook

I'm having some trouble spoofing my MAC address on my new MacBook Pro (OSX 10.13.6): it simply doesn't change -.-" On my prevous MacBook I created and used this script: #! /bin/bash echo "Old MAC:" sudo ifconfig en0 ether | grep…
Verim
  • 1,065
  • 9
  • 17
18
votes
2 answers

How to get MAC Address in Windows with C++?

I need some help with MAC addresses. I have to get it by using some code in C++ so could anybody help me with this? I've already tried a lot of useless codes. If exists any specific method or lib that I should study to find the MAC address, I will…
guiarrd
  • 531
  • 1
  • 4
  • 10
17
votes
9 answers

Get android Ethernet MAC Address (not wifi interface)

I'm using Android with Api level 8 and I want to get the Address of my Ethernet interface (eth0). On API level 8, the NetworkInterface class don't have the function getHardwareAddress(). The WifiManager also does not work since this is not an…
inversus
  • 1,287
  • 2
  • 15
  • 27
17
votes
3 answers

MySQL: Best way to store MAC addresses?

What's the best field type to use to store MAC addresses in a MySQL database? Also, should it be stored with a certain separator (colon or dash) or should it be stored without a separator?
Nick
  • 171
  • 1
  • 1
  • 3
17
votes
4 answers

Fixed identifier for a machine (uuid.getnode)

I'm trying to find something I can use as a unique string/number for my script that is fixed in a machine and easily obtainable(cross-platform). I presume a machine would have a network card. I don't need it to be really unique, but the necessary is…
Peter Badida
  • 11,310
  • 10
  • 44
  • 90
17
votes
1 answer

Docker MAC Address Generation

I had a question about applications running within Docker containers and UUID generation. Here’s our scenario: Currently our applications are using an event driven framework. For the events we generate the UUID’s based on mac address,…
Blanco
  • 185
  • 2
  • 8
17
votes
7 answers

Read MAC Address from network adapter in .NET

I'd like to be able to read the mac address from the first active network adapter using VB.net or C# (using .NET 3.5 SP1) for a winform application
Jeff
17
votes
5 answers

'ManagementClass' does not exist in the namespace 'System.Management'

Hi i'm using this method for get the mac address public string GetMACAddress() { System.Management.ManagementClass mc = default(System.Management.ManagementClass); ManagementObject mo = default(ManagementObject); mc = new…
Luca Romagnoli
  • 12,145
  • 30
  • 95
  • 157
17
votes
6 answers

How to get iOS device MAC address programmatically

How do I get an iOS device's MAC code programmatically in my app?
iPhoneDeveloper
  • 563
  • 2
  • 6
  • 9
16
votes
5 answers

Formatting MAC address in C#

In my C# application, I want to get my MAC address by using NetworkInterface class as the following: NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces() { mac = nic.GetPhysicalAddress() } But this code returns the MAC without ':'…
gln
  • 1,011
  • 5
  • 31
  • 61
1
2
3
70 71