Use Private Network interfaces
A Private Network interface is the virtual network interface that connects an Instance to a Private Network. Each Private Network interface has its own private IPv4 and IPv6 addresses, and can have a security group applied to it to filter the traffic it sends and receives.
Private Network interfaces exist independently of Instances. You can create a Private Network interface without attaching it to an Instance, or detach it from one Instance and attach it to another. It keeps its private IP addresses and its security group.
Each Private Network interface belongs to one Private Network, and an Instance can have up to 8 Private Network interfaces, each on a different Private Network.
You can apply one security group to each Private Network interface. Private Network interfaces only accept stateful security groups.
You do not need to power off your Instance to attach or detach a Private Network interface.
Before you start
To complete the following actions, you must have:
- A Scaleway account logged in to the console (External link)
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A Private Network
- (Optional) An Instance
- (Optional) A stateful security group
Create a Private Network interface
- In the Compute section of the side menu, click CPU & GPU Instances. The Instances page (External link) opens.
- Click the Private Network interfaces tab.
- Click Create a Private Network interface. The creation wizard opens.
- Choose the region in which to create your Private Network interface.
- Enter a name for your Private Network interface, or keep the randomly generated name. Optionally, add tags.
- Select the VPC and the Private Network to connect the Private Network interface to. You can only select a Private Network in the region you chose in step 4.
- Choose whether to auto-allocate an available IP address from the CIDR block of the Private Network, or use a reserved IP address. You must make this choice for both the Private IPv4 address and the Private IPv6 address.
- (Optional). Check the Attach to an Instance box, then select the Availability Zone and the Instance to attach the Private Network interface to.
- (Optional). Check the Apply a security group box, then select the Availability Zone and the security group to apply to the Private Network interface.
You can also attach an Instance or apply a security group after you create the Private Network interface. - Click Create Private Network interface.
The Private Network interfaces tab opens, and your new Private Network interface appears in the list.
Attach a Private Network interface to an Instance
When you attach a Private Network interface to an Instance, the Instance connects to the Private Network of the interface, using its private IP addresses. If a security group is applied to the Private Network interface, its rules filter the Private Network traffic of the Instance.
- In the Compute section of the side menu, click CPU & GPU Instances. The Instances page (External link) opens.
- Click the Private Network interfaces tab.
- In the Attached Instance column of the Private Network interface you want to attach, click Attach an Instance. A dialog box appears.
Alternatively, click the name of the Private Network interface, then click Actions > Attach to Instance. - Select the Availability Zone of the Instance. Only the Availability Zones within the region of the Private Network interface appear in the list.
- Select the Instance to attach the Private Network interface to.
- Click Attach to Instance.
The Instance connects to the Private Network and remains running during the operation.
Detach a Private Network interface from an Instance
When you detach a Private Network interface from an Instance, the Instance immediately disconnects from the associated Private Network. The Private Network interface keeps its private IP addresses and its security group, so you can attach it to another Instance later.
- In the Compute section of the side menu, click CPU & GPU Instances. The Instances page (External link) opens.
- Click the Private Network interfaces tab.
- Click more icon next to the Private Network interface you want to detach, then click Detach from Instance. A dialog box appears.
Alternatively, click the name of the Private Network interface, then click Actions > Detach from Instance. - (Optional). Check the Delete Private Network interface box to delete the Private Network interface after you detach it.
- Click Detach.
The Instance disconnects from the Private Network and remains running during the operation.
Change the security group of a Private Network interface
- In the Compute section of the side menu, click CPU & GPU Instances. The Instances page (External link) opens.
- Click the Private Network interfaces tab.
- Click more icon next to the Private Network interface, then click Change security group. A dialog box appears.
Alternatively, click the name of the Private Network interface, then click Actions > Change security group. - Select the security group to apply to the Private Network interface. The security group currently applied appears with a Current badge.
- Click Change security group.
The rules of the new security group apply to the traffic of the Private Network interface.
Delete a Private Network interface
You can only delete a Private Network interface that is not attached to an Instance. Detach it first if necessary.
- In the Compute section of the side menu, click CPU & GPU Instances. The Instances page (External link) opens.
- Click the Private Network interfaces tab.
- Click the name of the Private Network interface you want to delete. The overview page of the Private Network interface opens.
- Click the Settings tab.
- Click Delete Private Network interface. A dialog box appears.
- Confirm the deletion.
The Private Network interface is deleted.