<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 12.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/IPv6Address",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network11IPv6AddressV"
  },
  "title" : "IPv6Address"
}
-->

# IPv6Address

A structure containing an IPv6 address.

```
struct IPv6Address
```

## Topics

### Creating Addresses

[`init(_:)`](/documentation/Network/IPv6Address/init(_:))

Initializes an IPv6 address with a string.

[`init(_:_:)`](/documentation/Network/IPv6Address/init(_:_:))

Initializes an IPv6 address with data.

[`asIPv4`](/documentation/Network/IPv6Address/asIPv4)

Extracts the IPv4 address contained within the IPv6 address, if the IPv6 address is an IPv4-mapped or IPv4-compatible address.

### Inspecting Address Properties

[`rawValue`](/documentation/Network/IPv6Address/rawValue)

The raw data of an IPv6 address.

[`interface`](/documentation/Network/IPv6Address/interface)

The IPv6 scoped interface associated with this address.

[`multicastScope`](/documentation/Network/IPv6Address/multicastScope)

The IPv6 multicast scope of the address.

[`IPv6Address.Scope`](/documentation/Network/IPv6Address/Scope)

An IPv6 multicast scope.

[`isAny`](/documentation/Network/IPv6Address/isAny)

A Boolean indicating whether the address is the unspecified address (::).

[`is6to4`](/documentation/Network/IPv6Address/is6to4)

A Boolean indicating whether the address is a 6to4 address.

[`isIPv4Compatabile`](/documentation/Network/IPv6Address/isIPv4Compatabile)

A Boolean indicating whether the address is IPv4-compatible.

[`isIPv4Mapped`](/documentation/Network/IPv6Address/isIPv4Mapped)

A Boolean indicating whether the address is an IPv4-mapped address.

[`isLinkLocal`](/documentation/Network/IPv6Address/isLinkLocal)

A Boolean indicating whether this address is in a link-local range.

[`isLoopback`](/documentation/Network/IPv6Address/isLoopback)

A Boolean indicating whether this address is a loopback address for the local device.

[`isMulticast`](/documentation/Network/IPv6Address/isMulticast)

A Boolean indicating whether this address is a multicast address.

### Setting Well-Known Addresses

[`any`](/documentation/Network/IPv6Address/any)

The unspecified address (::).

[`broadcast`](/documentation/Network/IPv6Address/broadcast)

The unspecified broadcast address (::).

[`loopback`](/documentation/Network/IPv6Address/loopback)

The device’s loopback address (::1).

[`nodeLocalNodes`](/documentation/Network/IPv6Address/nodeLocalNodes)

The multicast address for all local nodes (ff01::1).

[`linkLocalNodes`](/documentation/Network/IPv6Address/linkLocalNodes)

The multicast address for all link-local nodes (ff02::1).

[`linkLocalRouters`](/documentation/Network/IPv6Address/linkLocalRouters)

The multicast address for all link-local routers (ff02::2).

### Comparing Addresses



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)