---
title: 'Tutorial: Configure Network Address Translation (NAT) on macOS'
canonical: https://openvpn.net/cloud-docs/tutorials/configuration-tutorials/connectors/operating-systems/macos/tutorial--configure-network-address-translation--nat--on-macos/
product: CloudConnexa Docs
description: This tutorial shows you the steps to take to enable NAT on your macOS computer.
keywords: NAT on macOS
---

# Tutorial: Configure Network Address Translation (NAT) on macOS

## **Steps: Enable NAT on macOS**

1. Create a file titled “`pf-nat.conf`” and add this rule:
   - `nat on enX from 100.96.0.0/11 to any -> enX`

     > **Note**
     >
     > Where `enX` is the main network interface of the host and `100.96.0.0/11` is the default WPC subnet. If the WPC subnet was changed in the CloudConnexa Portal - **Settings** \> **WPC**, "please replace 100.96.0.0/11, in the command above, with the updated IPv4 WPC subnet:
2. Save the **pf-nat.conf** file.
3. Start **pfctl** using the rule from the pf-nat.conf file.
   - `sudo pfctl -d` #disables `pfctl`
   - `sudo pfctl -F all` #flushes all `pfctl` rules
   - `sudo pfctl -f /Path/to/file/pf-nat.conf -e` #starts pfctl and loads the rules from the `pf-nat.conf` file

If you want the NAT rule to be permanent:

1. Create a backup of the default `pf.conf` file (`sudo cp -p /etc/pf.conf /etc/pf.conf.bak`)
2. Add your own rules to `/etc/pf.conf` (appending them after the default Apple anchors): `nat` on `enX` from `100.96.0.0/11` to any -\> `enX`
3. Load your custom rules (`sudo pfctl -f /etc/pf.conf)`
4. (Re)Enable the packet filter firewall (`sudo pfctl -E`)

## Related Tutorials

- [Tutorial: Configure macOS Computer to be a Router](https://openvpn.net/cloud-docs/tutorials/configuration-tutorials/connectors/operating-systems/macos/tutorial--configure-macos-computer-to-be-a-router.md)
- [Tutorial: Configure automatic login on macOS](https://openvpn.net/cloud-docs/tutorials/configuration-tutorials/connectors/operating-systems/macos/tutorial--configure-automatic-login-on-macos.md)
- [Tutorial: Install a Connector on macOS](https://openvpn.net/cloud-docs/tutorials/configuration-tutorials/connectors/operating-systems/macos/tutorial--install-a-connector-on-macos.md)

---

Prev: [Tutorial: Enable routing and NAT on macOS](https://openvpn.net/cloud-docs/tutorials/configuration-tutorials/connectors/operating-systems/macos/tutorial--enable-routing-and-nat-on-macos.md)
Next: [Tutorial: Configure macOS Computer to be a Router](https://openvpn.net/cloud-docs/tutorials/configuration-tutorials/connectors/operating-systems/macos/tutorial--configure-macos-computer-to-be-a-router.md)
Index: https://openvpn.net/cloud-docs/llms.txt
