Get the MAC address from the command line on SunOS

I know that I can get the MAC address of cards by using ifconfig -a.  The problem is I have to be root.  Is there another command that would allow me to see the MAC address as a reqular user?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

you don't need to be root to execute ifconfig. You probably don't have the path to /usr/sbin/ifconfig so type it with the full path or include /usr/sbin in the env variable PATH
joegoodAuthor Commented:
This is true but the output from ifconfig -a as a non-root user does not show the MAC address it only show IP address.  I need a command that will show the MAC address as a non-root user.
ok, i don't have a solaris machine handy, but i think the mac address is displayed on startup, so i think it should be shown with the dmesg command
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

as normal user you can use
/usr/sbin/arp <hostname>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
joegoodAuthor Commented:
Ok alextr answer one more question and I will give you the points.  Actually you will get the points anyway but I thought you could help me with this.  Doest the hostid command use the MAC address it looks like half of the id is the MAC address.

The hostid command prints the identifier of the current host in hexadecimal. There is no correlation between the two ones. The MAC is assigned by the vendor of the NIC and it is (should be!!) unique among all the NICs. The hostid is the identifier of the host.
When a license file is generated for a specific computer, it is locked to a number that is unique to that machine. For some Unix machines, the 32-bit hostid is used. For Linux, Mac, and Windows machines as well as other types of Unix machines, the ethernet (MAC) address is used
I hope it can help you

Just to reinforce alextr, the only sure fire way I have found of getting the mac address is, as any user on the system itself:

ping <hostname>; arp <hostname>

The command:
dmesg | grep Ethernet
will often give the on-board mac address, but if the machine has been up some time it may have been lost as new messages are written.

The hostid on older machines is related to the on-board ethernet mac address, but this does not apply to newer machines (works okay on a SunBlade 2000, but not on a v100).
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
Sun Host ID vs. MAc Address:
The mac address of sun ethernet adapter is being derived from the host ID (yes!)
unless you
a) set local-mac-address? = true in NVRAM
b) have an etnernet adapter of type qfe, hme (not onboard in Ex000/Ex500 !), eri
    or ge
In all other cases the last six letters from the host ID build the second half of the
MAC address on a sun (for all interfaces!)
To get the MAC address you can also try
  /usr/sbin/dmesg | grep -i ethernet
if the buffer has not flown over yet.
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
Forgot to mention: a) AND b) must be true (not OR)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.