<!--
{
  "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/IPv4Address",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network11IPv4AddressV"
  },
  "title" : "IPv4Address"
}
-->

# IPv4Address

A structure containing an IPv4 address.

```
struct IPv4Address
```

## Topics

### Creating Addresses

[`init?(String)`](/documentation/Network/IPv4Address/init(_:))

Initializes an IPv4 address with a string.

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

Initializes an IPv4 address with data.

### Inspecting Address Properties

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

The raw data of an IPv4 address.

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

The interface associated with this address.

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

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

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

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

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

A Boolean indicating whether this address is a multicast address.

### Setting Well-Known Addresses

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

The unspecified address (0.0.0.0).

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

The local broadcast address (255.255.255.255).

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

The device’s loopback address (127.0.0.1).

[`static let allHostsGroup: IPv4Address`](/documentation/Network/IPv4Address/allHostsGroup)

The multicast group for all hosts on the network segment (224.0.0.1).

[`static let allRoutersGroup: IPv4Address`](/documentation/Network/IPv4Address/allRoutersGroup)

The multicast group for all routers on the network segment (224.0.0.2).

[`static let allReportsGroup: IPv4Address`](/documentation/Network/IPv4Address/allReportsGroup)

The multicast group for all IGMPv3 reports (224.0.0.22).

[`static let mdnsGroup: IPv4Address`](/documentation/Network/IPv4Address/mdnsGroup)

The multicast group for multicast DNS (224.0.0.251).

### Comparing Addresses

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)