---
name: "packet.link.macaddr"
section: "3"
platform: "linux"
package: "nfstest"
version: "3.2-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/packet.link.macaddr"
---

# packet.link.macaddr(3)

MacAddr module

## NAME

packet.link.macaddr - MacAddr module

## DESCRIPTION

Create an object to represent a MAC address. A MAC address is given either by a series of hexadecimal numbers or using the ":" notation. It provides a mechanism for comparing this object with a regular string.

## CLASSES

### class MacAddr(builtins.str)

```
MacAddr address object
Usage:
    from packet.link.macaddr import MacAddr
    mac = MacAddr('E4CE8F589FF4')
The following expressions are equivalent:
    mac == 'E4CE8F589FF4'
    mac == 'e4ce8f589ff4'
    mac == 'e4:ce:8f:58:9f:f4'
```

**Methods defined here:** ---------------------

**\_\_eq\_\_(self, other)** Compare two MAC addresses and return True if both are equal.

**\_\_ne\_\_(self, other)** Compare two MAC addresses and return False if both are equal.

**Static methods defined here:** ----------------------------

**\_\_new\_\_(cls, mac)** Create new instance by converting input string into a persistent representation of a MAC address.

## BUGS

No known bugs.

## AUTHOR

Jorge Mora (mora@netapp.com)
