<!--
{
  "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?(String)`](/documentation/Network/IPv6Address/init(_:))

Initializes an IPv6 address with a string.

[`init?(Data, NWInterface?)`](/documentation/Network/IPv6Address/init(_:_:))

Initializes an IPv6 address with data.

[`var asIPv4: IPv4Address?`](/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

[`var rawValue: Data`](/documentation/Network/IPv6Address/rawValue)

The raw data of an IPv6 address.

[`let interface: NWInterface?`](/documentation/Network/IPv6Address/interface)

The IPv6 scoped interface associated with this address.

[`var multicastScope: IPv6Address.Scope?`](/documentation/Network/IPv6Address/multicastScope)

The IPv6 multicast scope of the address.

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

An IPv6 multicast scope.

[`var isAny: Bool`](/documentation/Network/IPv6Address/isAny)

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

[`var is6to4: Bool`](/documentation/Network/IPv6Address/is6to4)

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

[`var isIPv4Compatabile: Bool`](/documentation/Network/IPv6Address/isIPv4Compatabile)

A Boolean indicating whether the address is IPv4-compatible.

[`var isIPv4Mapped: Bool`](/documentation/Network/IPv6Address/isIPv4Mapped)

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

[`var isLinkLocal: Bool`](/documentation/Network/IPv6Address/isLinkLocal)

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

[`var isLoopback: Bool`](/documentation/Network/IPv6Address/isLoopback)

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

[`var isMulticast: Bool`](/documentation/Network/IPv6Address/isMulticast)

A Boolean indicating whether this address is a multicast address.

### Setting Well-Known Addresses

[`static let any: IPv6Address`](/documentation/Network/IPv6Address/any)

The unspecified address (::).

[`static let broadcast: IPv6Address`](/documentation/Network/IPv6Address/broadcast)

The unspecified broadcast address (::).

[`static let loopback: IPv6Address`](/documentation/Network/IPv6Address/loopback)

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

[`static let nodeLocalNodes: IPv6Address`](/documentation/Network/IPv6Address/nodeLocalNodes)

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

[`static let linkLocalNodes: IPv6Address`](/documentation/Network/IPv6Address/linkLocalNodes)

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

[`static let linkLocalRouters: IPv6Address`](/documentation/Network/IPv6Address/linkLocalRouters)

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

### Comparing Addresses

### Instance Properties

[`var isUniqueLocal: Bool`](/documentation/Network/IPv6Address/isUniqueLocal)

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`IPAddress`](/documentation/Network/IPAddress)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

---

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)