查找MAC地址的办法
1 OK >banner
Sun (TM) Enterprise 250 (2 X UltraSPARC-II 296MHz), No Keyboard
OpenBoot 3.7, 1024 MB memory installed, Serial #9311264.
Ethe.net address 8:0:20:8e:14:20, Host ID: 808e1420.
2 properties or .attributes
.properties用于SUN4U架构,.attributes用于SUN4M和SUN4C架构
ok show-nets //will give you the device path for the interface//
ok cd //change to device path//
ok .properties // this should show you the MAC address of that interface//
举例 ( sun4u ):
ok show-nets a) /pci@1f,0/pci@1/network@3
b) /pci@1f,0/pci@1/network@1
c) /pci@1f,0/pci@1/pci@4/network@0
d) /pci@1f,0/pci@1,1/network@1,1
q) NO SELECTION
Enter Selection, q to quit: q
ok cd /pci@1f,0/pci@1/network@3
ok .properties
assigned-addresses 82021810 00000000 00800000 00000000 00009060
local-mac-address 08 00 20 89 94 32
举例 ( sun4m ) :
ok cd /io-unit@f,e0200000/sbi@0,0/SUNW,qfe@2,8c00000
ok .attributes
local-mac-address 08 00 20 8d 8d 64
3 showplatform 仅用于Sun Fire Servers
schostname:SC> showplatform -v
或者
schostname:SC> showplatform mac
MAC Address HostID
----------------- --------
Domain A 08:00:20:d8:a8:37 80d8a837
Domain B 08:00:20:d8:a8:38 80d8a838
Domain C 08:00:20:d8:a8:39 80d8a839
Domain D 08:00:20:d8:a8:3a 80d8a83a
SSC0 08:00:20:d8:a8:3b 80d8a83b
SSC1 08:00:20:d8:a8:3c 80d8a83c
4 prtconf
$ prtconf -pv |grep idprom(用于主板自带的le或hme)
idprom:
01800800.208d7e88.00000000.8d7e88a9.00000000.00000000.00000000.00000000
^^^^^^^^^^^^^
08:00:20:8d:7e:88
(对于后来安装的网卡 qfe )
$ prtconf -pv |grep local-mac-address
local-mac-address?: 'true'
local-mac-address: 0800208d.7828
local-mac-address: 0800208d.7829
local-mac-address: 0800208d.782a
local-mac-address: 0800208d.782b
5 从启动信息里面查找
# dmesg
或者
# more /var/adm/messages
Ethernet address = 8:0:20:87:b3:50
SUNW,qfe3: Local Ethernet address = 8:0:20:aa:dd:2b
SUNW,qfe3: Using local MAC addressEthernet address = 8:0:20:87:b3:50
6 ifconfig
# ifconfig hme0
hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.1 netmask ffffff00 broadcast 192.168.10.255
ether 8:0:20:9e:e7:95
# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500
index 2
inet 192.148.12.11 netmask ffffff00 broadcast 129.148.12.255
ether 8:0:20:87:b3:50
ce0: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 192.148.12.8 netmask 0
ether 8:0:20:bc:d7:82
7 netstat -pn 或 arp -a
# netstat -pn |grep SP
hme0 192.168.10 255.255.255.255 SP 08:00:20:9e:e7:95
# arp -a |grep SP
hme0 hodware 255.255.255.255 SP 08:00:20:9e:e7:95
% /usr/sbin/ping 192.9.200.88
%/usr/sbin/arp –a
hme0 192.9.200.88 255.255.255.255 00:03:ba:36:22:8f
【发表回复】【查看CU论坛原帖】【添加到收藏夹】【关闭】
随意江湖行 回复于:2003-11-06 17:12:23 |
多谢版主!
好东东! 顶ing! |
lsw 回复于:2003-11-06 17:26:40 |
好 |
solaris2.6 回复于:2004-01-12 09:51:09 |
好东东,谢谢了! |
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/