LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-11-2005, 10:17 AM   #1
Metablade
LQ Newbie
 
Registered: Oct 2005
Location: Los Angeles
Distribution: Enterprise
Posts: 26

Rep: Reputation: 15
How to obtain the MAC adress for your NIC


Hello,
My question is:
How may I obtain my NIC card's Mac address using a command line in Linux?
Additionally Is this possible, and specifically what would I require I for? (aside from having the benefit of knowing what it is)
I assume that in attempting to connect to another computer, I'll need this in a file somewhere?

Or does Linux and another computer on the network automatically detect the MAC address?
I am a bit confused on why there would be a specific "need" to (if there is one) to know this.

Thank you.
 
Old 10-11-2005, 10:25 AM   #2
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
To see it just run "ifconfig", and look under the nic you want (probably eth0). You don't need to know it, the computers just need to know each other's ip address.
 
Old 10-11-2005, 10:30 AM   #3
Metablade
LQ Newbie
 
Registered: Oct 2005
Location: Los Angeles
Distribution: Enterprise
Posts: 26

Original Poster
Rep: Reputation: 15
Thank you sir.

I ran "ifconfig" and I get a short display.
But I see nothing that says "eth0" (This should be my NIC card, yes?)
Would I be looking for a hexidecimal number?

Thanks again!
 
Old 10-11-2005, 11:17 AM   #4
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
It might have a different name, the mac will look like 00:00:00:00:00:00, with various letters/numbers. The ip address is more important, like 192.168.1.1 for example.
 
Old 10-11-2005, 11:32 AM   #5
Metablade
LQ Newbie
 
Registered: Oct 2005
Location: Los Angeles
Distribution: Enterprise
Posts: 26

Original Poster
Rep: Reputation: 15
Hmmm..
Nothing like that on my system.
Here's what I get in response to ifconfig:
Link encap: Local Loopback
inet addr : 127.0.0.1 (Which I assume is home, Yes?)
Mask: 255.0.0.0
UP LOOPBACK RUNNING MTU: 16436 METRIC :1
RX packets :8 errors:0 dropped :0 overruns :0 frame :0
TX packets :8 errors :0 dropped :0 overruns :0 carrier :0
collisions :0 txqueuelen :0
RX bytes :560 (560.0b) TX bytes :560 (560.0b)


What does all of this mean?

-Thank you
 
Old 10-11-2005, 11:36 AM   #6
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
That is lo device, which is something else. Try "ifconfig eth0" (guessing at the name again). It won't appear with just ifconfig if it is inactive.
 
Old 10-11-2005, 12:01 PM   #7
Metablade
LQ Newbie
 
Registered: Oct 2005
Location: Los Angeles
Distribution: Enterprise
Posts: 26

Original Poster
Rep: Reputation: 15
Bingo!
I think that's done it!
I receive:
HW 000:59:15:6C:07

I belive this is it.

Now, that said,
Why would I ever need to know this?
I seem to remember other sys ads referencing the MAC address, but had no idea why they needed it.
 
Old 10-11-2005, 01:15 PM   #8
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
It's rarely needed. The other computer figures it out automatically if it needs it. It could be used to id a machine as each nic has a unique mac but you rarely need to worry about it. The important thing is the ip address, which is either also done automatically by dhcp, or set manually by you.
 
Old 10-11-2005, 01:44 PM   #9
Metablade
LQ Newbie
 
Registered: Oct 2005
Location: Los Angeles
Distribution: Enterprise
Posts: 26

Original Poster
Rep: Reputation: 15
Thank you once again!
 
  


Reply



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
changing MAC adress? e1000 Linux - Wireless Networking 3 07-08-2004 05:13 PM
Is it possible to find an IP address from a MAC-adress? TheSpork Linux - Networking 1 06-30-2004 02:48 AM
Getting NIC MAC adress thar Linux - Networking 3 06-28-2004 11:38 PM
Mac and ip adress kater0000 Linux - Networking 15 04-05-2004 06:04 PM
I need to change the MAC adress (can't connect to the net) Agna Linux - Newbie 4 03-15-2004 01:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:02 AM.

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