Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  NET::ADDRESS::ETHERNET (3)

.ds Aq ’


Net::Address::Ethernet - find hardware ethernet address



  use Net::Address::Ethernet qw( get_address );
  my $sAddress = get_address;


The following functions will be exported to your namespace if you request :all like so:

  use Net::Address::Ethernet qw( :all );

get_address Returns the 6-byte ethernet address in canonical form. For example, ’1A:2B:3C:4D:5E:6F’.

When called in array context, returns a 6-element list representing the 6 bytes of the address in decimal. For example, (26,43,60,77,94,111).

If any non-zero argument is given, debugging information will be printed to STDERR.

get_addresses Returns an array of hashrefs. Each hashref describes one Ethernet adapter found in the current hardware configuration, with the following entries filled in to the best of our ability to determine:
sEthernet — The MAC address in canonical form.
rasIP — A reference to an array of all the IP addresses on this adapter.
sIP — The ‘‘first’’ IP address on this adapter.
sAdapter — The name of this adapter.
iActive — Whether this adapter is active.

For example:

   sAdapter => Ethernet adapter Local Area Connection,
   sEthernet => 12:34:56:78:9A:BC,
   rasIP => [,],
   sIP =>,
   iActive => 1,

If any non-zero argument is given, debugging information will be printed to STDERR.

is_address Returns a true value if its argument looks like an ethernet address.
canonical Given a 6-byte ethernet address, converts it to canonical form. Canonical form is 2-digit uppercase hexadecimal numbers with colon between the bytes. The address to be converted can have any kind of punctuation between the bytes, the bytes can be 1-digit, and the bytes can be lowercase; but the bytes must already be hex.



arp, ifconfig, ipconfig


Please tell the author if you find any! And please show me the output of ‘arp <hostname>‘ or ‘ifconfig‘ or ‘ifconfig -a‘ from your system.


Martin ’Kingpin’ Thurn, mthurn at, <>.


This software is released under the same license as Perl itself.

#### This is an example of @ahInfo on MSWin32: (
’sAdapter’ => ’Ethernet adapter Local Area Connection’,
’sEthernet’ => ’00-0C-F1-EE-F0-39’,
’sIP’ => ’’,
’iActive’ => 1,
’sAdapter’ => ’Ethernet adapter Wireless Network Connection’,
’sEthernet’ => ’00-33-BD-F3-33-E3’,
’sIP’ => ’’,
’iActive’ => 1,
’sAdapter’ => ’{gobbledy-gook}’,
’sDesc’ => ’PPP adapter Verizon Online’,
’sEthernet’ => ’00-53-45-00-00-00’,
’sIP’ => ’’,
’iActive’ => 1,
}, )

#### This is Solaris 8:

> /usr/sbin/arp myhost myhost ( at 03:33:ba:46:f2:ef permanent published

#### This is Solaris 8:

> /usr/sbin/ifconfig -a lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet netmask ff000000 bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet netmask ffffff00 broadcast

#### This is Fedora Core 6:

$ /sbin/arp Address HWtype HWaddress Flags Mask Iface ether 03:53:53:e3:43:93 C eth0

#### This is amd64-freebsd:

$ ifconfig fwe0: flags=108802<BROADCAST,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
ether 02:31:38:31:35:35
ch 1 dma -1 vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe8d::2500:bafd:fecd:cdcd%vr0 prefixlen 64 scopeid 0x2
inet netmask 0xffffff00 broadcast
ether 00:53:b3:c3:3d:39
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe8e::21e:31ef:fee1:26eb%nfe0 prefixlen 64 scopeid 0x3
ether 00:13:33:53:23:13
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
inet netmask 0xff000000
inet netmask 0xffffffff
inet netmask 0xffffffff tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1492
inet --> netmask 0xffffffff
Opened by PID 268

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 NET::ADDRESS::ETHERNET (3) 2015-11-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.