Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there any way I can obtain the MAC Address/interface name from GUI on FreeBSD? Are there any system calls to do that? I was searching everywhere but couldn't find any information. Can you please help?

Thanks a lot in advance.

Best Regards, Marc.

share|improve this question

1 Answer 1

I realize you're looking for a GUI way to do this but you can get the MAC Address from the command line like so:

$ ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=b<RXCSUM,TXCSUM,VLAN_MTU>
        inet6 fe80::20c:29ff:fefd:f61d%em0 prefixlen 64 scopeid 0x1
        inet 198.18.152.169 netmask 0xffff0000 broadcast 198.18.255.255
        ether 00:0c:29:fd:f6:1d
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active

The MAC Address is the string after the word "ether", 00:0c:29:fd:f6:1d. You can see all the network devices with this command:

$ ifconfig -a

see the ifconfig man page for more info.

Example

ifconfig em0 | awk '/ether/ {print $2}'
00:0c:29:fd:f6:1d
share|improve this answer
    
Thanks a lot.. This was helpful. I was more looking for a programmatic way to get the details. –  Marc Spencer Apr 24 '13 at 8:43
    
See the example I added to my answer. You can adjust it to suite your needs. –  slm Apr 24 '13 at 8:47
    
Useless use of grep: ifconfig em0 | awk '/ether/ {print $2}' –  ptman Apr 24 '13 at 9:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.