Skip to contents

Lists the hardware (MAC) address of each network interface of the local machine. Works on Linux (reads /sys/class/net), macOS and other Unix systems (parses ifconfig -a) and Windows (parses getmac).

Usage

get_MAC(include_null = FALSE)

Arguments

include_null

Logical. Keep interfaces whose address is 00:00:00:00:00:00 (e.g. the loopback interface)?

Value

A named character vector of normalized MAC addresses (XX:XX:XX:XX:XX:XX), named by interface. If the addresses cannot be read, a warning is given and an empty vector is returned.

Examples

get_MAC()
#>             docker0          enP32411s1                eth0 
#> "7E:CC:B0:BB:3A:3C" "70:A8:A5:45:FF:5C" "70:A8:A5:45:FF:5C"