LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-19-2006, 10:26 AM   #1
Micik
Member
 
Registered: Dec 2004
Distribution: Red hat linux 9
Posts: 189

Rep: Reputation: 16
find out MAC and IP address


Hello guys,
how can I find out MAC address and also IP addresses of my computer under linux console.
I know that in Win XP there is a cmd command ipconfig to get IP informations.
What about linux?
Thanks
 
Old 08-19-2006, 10:29 AM   #2
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
ifconfig or /sbin/ifconfig
 
Old 08-19-2006, 10:30 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Command line is "ifconfig". It will show you MACs,/IPs and other parameters of all NICs if you pass no options to it.

MAC is listed as HWaddr

Note that lo = Loop back - not a real NIC so has no MAC.
 
Old 08-20-2006, 03:25 AM   #4
Crushing Belial
Member
 
Registered: Mar 2005
Location: University of Massachusetts - Lowell
Distribution: Ubuntu, Win 7 Pro, Win 7 Enterprise
Posts: 126

Rep: Reputation: 15
I have a similar question I was hoping you could answer. How can I find out the IP address of a machine on my LAN, such as my GameCube? I have run Linux on my GameCube in the past, and I recently bought a new router, so my GameCube's IP address has changed. How can I find out what it is?
 
Old 08-20-2006, 05:35 AM   #5
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
As far as I know there is no straightforward way to identify the IP address of a single host on the network unless your using a name resolution service and know the hostname of the specific host in question.

/sbin/arp -v

This will display the MAC addresses and the corresponding IP addresses of hosts that your machine has had contact with. I have found this method rather useless since this assumes you know the target host's MAC.

A technique I have found a little more useful is to use a combination of ping broadcasts and nmap.

First perform a broadcast ping to all hosts on your network.

ping -b <broadcast address>

For example on a network with address and subnet:
192.168.0.0/24

ping -b 192.168.0.255

This will give you a list of all 'live' hosts on your network.

Next use the nmap -vAO command to identify the OS on a specific system.
Example:

nmap -vAO 192.168.0.10

However, this again assumes that you have an idea of what to look for (specific ports/services and unique OS). Its time consuming so is really only effective for small networks.

Last edited by SlackDaemon; 08-20-2006 at 11:19 PM.
 
Old 08-20-2006, 09:36 AM   #6
Micik
Member
 
Registered: Dec 2004
Distribution: Red hat linux 9
Posts: 189

Original Poster
Rep: Reputation: 16
Ok, thanks guys, always reliable as ever...
 
Old 08-20-2006, 12:19 PM   #7
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
You can also use nmap to scan your whole network so If you do not know what the ipaddress of the host you are try to contact then let nmap find it for you.
 
Old 09-04-2006, 01:46 AM   #8
Micik
Member
 
Registered: Dec 2004
Distribution: Red hat linux 9
Posts: 189

Original Poster
Rep: Reputation: 16
Thanks, but how to use nmap?
Does it meant that If i don't know what are Ip addresses are of compuuters in my network, I can use nmap to find them?
Thanks
 
Old 09-04-2006, 03:07 AM   #9
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
can't you just look on the dhcp settings page of your router??

all the machines connected to the router should show up there.
 
Old 09-04-2006, 08:12 AM   #10
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by Micik
Thanks, but how to use nmap?
Does it meant that If i don't know what are Ip addresses are of compuuters in my network, I can use nmap to find them?
Thanks
Sure. I use that here at work to find out whats on my network. Check out this page. This is what I used to learn more about nmap. http://insecure.org/ it also has other security tools that you can look into.
 
Old 09-04-2006, 08:14 AM   #11
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
forgot, just to get you started just run this
nmap 192.168.1.0/16 [or what ever you are using for internal IP scheme]
 
  


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
How to find an IP address from the MAC address of a remote machine ? jitz Linux - General 3 01-03-2006 07:55 AM
How to find IP address of a machine if I know their MAC Address dysenteryduke Linux - Networking 13 09-12-2005 10:21 AM
How to find MAC address of a specified IP address ? longtongfish Programming 1 07-12-2005 03:26 PM
how can i find mac address compzoo Linux - Networking 3 02-03-2005 02:02 PM
how would you find the mac address bhupee Linux - Newbie 5 07-05-2004 06:07 PM

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

All times are GMT -5. The time now is 01:20 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