Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-10-2009, 08:44 PM   #1
Registered: Aug 2008
Posts: 50

Rep: Reputation: 0
Get the MAC address in Linux Device Driver


I want to get the ethernet address (MAC address) in kernel module. How to do that?

Old 12-10-2009, 10:05 PM   #2
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
If you're asking how to write a kernel module that will report a MAC address, look at the source code for some prigran that does that. For example, the program invoked by the ifconfig script reports the MAC address.

I suspect that the MAC address can by found by reading the correct file in the /proc pseudo-files. Almost all system information is available there.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
"...Device eth0 has different MAC address than expected,.." lothario Linux - Networking 11 08-05-2014 11:24 PM
Getting MAC Address with C++ (Linux) silentangel Programming 7 11-03-2012 03:36 PM
eth0: Device eth0 has different MAC address than expected,ignoring. lin1010 Linux - Networking 5 11-24-2010 08:30 AM
MAC address changes on every boot using nForce ethernet driver Version 0.61 Gflopper Linux - Hardware 8 01-07-2009 11:18 AM
Debian Etch - Ethernet Device and MAC address changes after reboot IBall Debian 2 06-07-2007 10:58 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:46 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration