<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEIPv4Settings"
  },
  "title" : "NEIPv4Settings"
}
-->

# NEIPv4Settings

The IPv4 settings of an IP layer network tunnel.

```
class NEIPv4Settings
```

## Overview

To specify the IPv4 settings of a packet tunnel, set its [`NEPacketTunnelNetworkSettings`](/documentation/NetworkExtension/NEPacketTunnelNetworkSettings).[`ipv4Settings`](/documentation/NetworkExtension/NEPacketTunnelNetworkSettings/ipv4Settings) property to an instance of this class.

## Topics

### Initializing IPv4 settings

[`-  initWithAddresses:subnetMasks:`](/documentation/NetworkExtension/NEIPv4Settings/init(addresses:subnetMasks:))

Initializes an IPv4 settings object.

### Accessing IPv4 properties

[`addresses`](/documentation/NetworkExtension/NEIPv4Settings/addresses)

The IPv4 addresses to assign to the TUN interface.

[`subnetMasks`](/documentation/NetworkExtension/NEIPv4Settings/subnetMasks)

The IPv4 network masks to assign to the TUN interface.

[`router`](/documentation/NetworkExtension/NEIPv4Settings/router)

The address of the next-hop gateway router represented as a dotted decimal string.

### Routing network traffic

[`includedRoutes`](/documentation/NetworkExtension/NEIPv4Settings/includedRoutes)

The IPv4 network traffic that the system routes to the TUN interface.

[`excludedRoutes`](/documentation/NetworkExtension/NEIPv4Settings/excludedRoutes)

The IPv4 network traffic that the system routes to the primary physical interface, not the TUN interface.

[`NEIPv4Route`](/documentation/NetworkExtension/NEIPv4Route)

The settings for an IPv4 route.

## Relationships

### Conforms To

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

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

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

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

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSCopying`](/documentation/Foundation/NSCopying)

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

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)