<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEIPv4Settings/init(addresses:subnetMasks:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEIPv4Settings(im)initWithAddresses:subnetMasks:"
  },
  "title" : "init(addresses:subnetMasks:)"
}
-->

# init(addresses:subnetMasks:)

Initializes an IPv4 settings object.

```
init(addresses: [String], subnetMasks: [String])
```

## Parameters

`addresses`

An array of IPv4 address strings. These IPv4 addresses will be assigned to the tunnel’s TUN interface.

`subnetMasks`

An array of IPv4 network mask strings. Each mask in this array is combined with the IP address in the corresponding index in `addresses` to specify an IPv4 network that the TUN interface is (virtually) connected to.

## Return Value

The initialized NEIPv4Settings object.

---

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)