Well, most of the Linux and Solaris users should probably know that 'ifconfig' is the command to get and manage your network interfaces - something similar to 'ipconfig' on Windows but just more powerful. Anyway, what I didn't realize is that on OpenSolaris , you will need to run the ifconfig in the following way to get the MAC address .

pfexec /usr/sbin/ifconfig -a

Hope, some one finds this useful.

Comments:

/usr/bin/netstat -pn | /usr/bin/grep SP

Posted by 64.32.173.115 on May 18, 2008 at 01:49 AM PDT #

pfexec is a utility that used to execute command with the attributes specified by the user's profile. instead of long type command like you do, i prefer to use this $ ipconfig -a

nice article..

Posted by riesal on November 10, 2008 at 09:47 PM PST #

Thanks very much for the info from the comment it worked a treat:

/usr/bin/netstat -pn | /usr/bin/grep SP

Posted by John on February 03, 2009 at 04:02 PM PST #

/usr/bin/netstat -pn | /usr/bin/grep SP only works if the interface is up. Also ifconfig -a without pfexec (running just as the user) doesn't have sufficient privileged to get the MAC address. Where as how the original article suggests works when the interface is down and has sufficient privileged to get the mac address. Thanks!

Posted by rajha.korithrien on February 10, 2009 at 03:19 PM PST #

Thanks for posting this. I'm a linux user setting up an open solaris box for the first time and this was exactly what I was looking for, having already run ifconfig without pfexec.

Posted by Nick on March 17, 2009 at 02:33 PM PDT #

Hi,

Is it possible to use this to switch the mac address of a network card.

Best regards
Stephen

Posted by stephen whyte on November 04, 2009 at 01:11 PM PST #

mac address is unique to a given ethernet card.so, it should not be possible to give different mac address. however, you can switch different IP address associated with a given mac address.

Posted by Sriram Natarajan on November 04, 2009 at 01:15 PM PST #

by default, OpenSolaris boots up in DHCP mode (that is dynamically obtained IP address). if you want to change IP address to other IP like static IP or any other address, you will need to following

svcadm disable physical:nwam (to disable dhcp which is default in opensolaris installation)

now, edit /etc/hosts and add the following line
<new ip address> <hostname>

now, edit /etc/netmasks and add the netmask
255.255.255.0 (or whatever in your network)

now, edit /etc/default/router and add the gateway of your network
192.168.120.1

finally start the service (static IP service) by doing some thing like
svcadm enable -s physical:default

for further questions, please visit either opensolaris forum like below
http://opensolaris.org/jive/thread.jspa?threadID=84556

or visit the wiki file
http://204.152.191.100/wiki/index.php/Change_IP_Address_HOWTO

or also check this link
http://blogs.sun.com/natarajan/entry/setting_up_static_ip_and

hope this helps

svcadm enable physical:default (to enable static IP address)

Posted by Sriram Natarajan on November 05, 2009 at 09:48 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by natarajan