How to remove the public IP address of a Mac mini
After enabling Virtual Private Cloud (VPC) on your Mac mini, you can enhance the security of your server by further restricting external access. This guide walks you through a series of steps to ensure that your Mac Mini is isolated from unauthorized access while maintaining necessary connectivity for management and maintenance.
By following these instructions, you will learn how to create a secure environment that uses Private Networks and an SSH Bastion to protect your machine from being reachable on the public Internet, while maintaining outgoing connectivity from the Mac mini.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A Mac mini
Enabling Private Networks for your Mac mini
- Click Apple silicon in the Bare Metal section of the side menu. The Apple silicon splash screen displays.
- Click the Mac mini you want to enable Private Networks on. The Mac mini's Overview page displays.
- In the Private Networks feature section, click Enable Private Networks to enable the feature. A pop-up displays, asking you to confirm that you want to enable Private Networks, and showing the estimated cost.
- Click Enable Private Networks.
Setting up Private Networks/VLAN
- Click Apple silicon in the Bare Metal section of the side menu. The Apple silicon splash screen displays.
- Click the Mac mini you want to attach to a Private Network. The Mac mini's Overview page displays.
- Click the Private Networks tab.
- Click + Attach to a Private Network. A pop-up displays.
- Select the Private Network you want to attach the Mac mini to. You can either auto-allocate an available IP from the Private Network's pool (default) or reserve a specific IP for your Mac mini using IPAM.
- Click Attach to Private Network.
Configuring the Private Network on your Mac mini
On your Mac mini, set up the Private Network/VLAN. You can follow our guide How to configure the VLAN interface on your Mac mini for Private Networks for more information.
Setting up a Public Gateway with SSH Bastion
- Create a Public Gateway.
- Enable SSH Bastion. This will allow you to securely access your Mac mini.
- Connect to your machine through the Bastion. Verify that you can connect to your Mac mini through the Bastion.
Disabling DHCP on the public interface and removing the public IP address
Once you have verified that your Mac mini is reachable through the Bastion, you can proceed with disabling DHCP on your Mac's main network interface (en0
) and removing its public address.
- Open a terminal on your Mac mini.
- Run the following command to disable DHCP and remove the public IP address from the Ethernet interface:
sudo networksetup -setv4off "Ethernet" <PUBLIC_INTERFACE_IP_ADDRESS>
Your Mac mini is now fully isolated from the public internet, and any further external access will have to occur from a resource inside the Private Network or through the Bastion.