Solved

How do I get a list of MAC address, including ones that do not have IP addresses bound?

Posted on 2012-03-28
5
301 Views
Last Modified: 2012-06-27
How do I get a list of MAC address, including ones that do not have IP addresses bound?

ifconfig appears to only return MAC address if they have IP addresses. I need to get all of the MAC addresses, regardless of whether or not are bound.

In Windows, this is easily done with the getmac, but I have not been able to find the UNIX/Linux equivalent.
0
Comment
Question by:Mister_Tog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 250 total points
ID: 37778573
ip a
0
 
LVL 1

Author Comment

by:Mister_Tog
ID: 37778609
ip a appears to just return address that have IP addresses, like ifconfig -a. I need to return ethernet addresses that do not have an IP address bound.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 37778648
Well, it always showed me all the MAC.

How about this?
ip maddr show
0
 
LVL 21

Accepted Solution

by:
Papertrip earned 250 total points
ID: 37778874
Which OS are you running?  Both ip a and ifconfig -a show interfaces that do not have an IP assigned on RHEL -- note eth1 in the following example.  Issuing just ifconfig without the -a however will only show interfaces that are up.

[root@phx1mmail1 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 1c:c1:de:e5:51:10 brd ff:ff:ff:ff:ff:ff
    inet 10.190.3.105/26 brd 10.190.3.127 scope global eth0
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 1c:c1:de:e5:51:12 brd ff:ff:ff:ff:ff:ff

[root@phx1mmail1 ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 1C:C1:DE:E5:51:10  
          inet addr:10.190.3.105  Bcast:10.190.3.127  Mask:255.255.255.192
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:56068823208 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47944747928 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:21919365848940 (19.9 TiB)  TX bytes:23347617517672 (21.2 TiB)
          Interrupt:130 Memory:f8000000-f8012800 

eth1      Link encap:Ethernet  HWaddr 1C:C1:DE:E5:51:12  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:138 Memory:f6000000-f6012800 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3163770555 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3163770555 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:355390764000 (330.9 GiB)  TX bytes:355390764000 (330.9 GiB)

[root@phx1mmail1 ~]# 

Open in new window

0
 
LVL 1

Author Closing Comment

by:Mister_Tog
ID: 37789449
It looks like you are right, ifconfig -a works. I should not that "ip a" doesn't seem to work on Solaris.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question