---
title: "vmnet_network_configuration_set_ipv4_subnet(_:_:_:)"
framework: vmnet
role: symbol
role_heading: Function
platforms: [Mac Catalyst 13.0+, macOS 26.0+]
path: "vmnet/vmnet_network_configuration_set_ipv4_subnet(_:_:_:)"
---

# vmnet_network_configuration_set_ipv4_subnet(_:_:_:)

Configures the IPv4 addresses of a vmnet network.

## Declaration

```swift
func vmnet_network_configuration_set_ipv4_subnet(_ config: vmnet_network_configuration_ref, _ subnet_addr: UnsafePointer<in_addr>, _ subnet_mask: UnsafePointer<in_addr>) -> vmnet_return_t
```

## Parameters

- `config`: The network configuration object to be modified.
- `subnet_addr`: The subnet address.
- `subnet_mask`: The subnet mask.

## Return Value

Return Value VMNET_SUCCESS on success, error otherwise.

## Discussion

Discussion note: The framework reserves the first, second, and last addresses of the range. The second address is reserved for the host, the first and last are not assignable to any node.

## See Also

### Customizing a network configuration

- [vmnet_network_configuration_ref](vmnet/vmnet_network_configuration_ref.md)
- [vmnet_network_configuration_add_dhcp_reservation(_:_:_:)](vmnet/vmnet_network_configuration_add_dhcp_reservation(_:_:_:).md)
- [vmnet_network_configuration_add_port_forwarding_rule(_:_:_:_:_:_:)](vmnet/vmnet_network_configuration_add_port_forwarding_rule(_:_:_:_:_:_:).md)
- [vmnet_network_configuration_disable_router_advertisement(_:)](vmnet/vmnet_network_configuration_disable_router_advertisement(_:).md)
- [vmnet_network_configuration_disable_nat66(_:)](vmnet/vmnet_network_configuration_disable_nat66(_:).md)
- [vmnet_network_configuration_disable_nat44(_:)](vmnet/vmnet_network_configuration_disable_nat44(_:).md)
- [vmnet_network_configuration_disable_dns_proxy(_:)](vmnet/vmnet_network_configuration_disable_dns_proxy(_:).md)
- [vmnet_network_configuration_disable_dhcp(_:)](vmnet/vmnet_network_configuration_disable_dhcp(_:).md)
- [vmnet_nat66_prefix_length_key](vmnet/vmnet_nat66_prefix_length_key.md)
- [vmnet_nat66_prefix_key](vmnet/vmnet_nat66_prefix_key.md)
- [vmnet_port_forwarding_rule_get_details(_:_:_:_:_:)](vmnet/vmnet_port_forwarding_rule_get_details(_:_:_:_:_:).md)
- [vmnet_network_configuration_set_external_interface(_:_:)](vmnet/vmnet_network_configuration_set_external_interface(_:_:).md)
- [vmnet_network_configuration_set_ipv6_prefix(_:_:_:)](vmnet/vmnet_network_configuration_set_ipv6_prefix(_:_:_:).md)
- [vmnet_network_configuration_set_mtu(_:_:)](vmnet/vmnet_network_configuration_set_mtu(_:_:).md)
- [vmnet_network_get_ipv6_prefix(_:_:_:)](vmnet/vmnet_network_get_ipv6_prefix(_:_:_:).md)
