Network interface
Overview
A network interface (Network Interface Card, NIC) is the virtual NIC that connects a VM to a subnet. One is created automatically when you create a VM, but you can also pre-create NICs separately or manage them directly when you need a multi-NIC configuration.
- A VM can have multiple NICs attached (and they can sit on different subnets)
- Each NIC carries one IP and one MAC
- Public IPs attach to the NIC to provide internet access
Creating a NIC
-
Under Network > Network Interfaces, click Create Network Interface.
-
Configure the following:
Field Description Name An identifying name (e.g. web-nic-1)Zone Must be the same zone as the VM it will attach to Subnet The subnet the interface belongs to IP address Choose any IP inside the subnet CIDR (leave blank to auto-assign) MAC address Auto-generated when blank; for manual entry, use 00:1B:44:11:3A:B7formatDisaster recovery Must match the VM (DR VMs accept only DR NICs) IP forwarding Allow the NIC to send/receive packets not destined to its own IP (off by default) — for NAT/router/VPN use -
Click Create.
DR VMs accept only DR-enabled NICs, and standard VMs accept only standard NICs. Mismatches are rejected at attach time.
Attaching and detaching a NIC
- Open the target VM in Compute > Virtual Machines.
- Move the VM to the Stopped state.
- In the VM edit screen, under Network Interfaces, add the NIC to attach.
- Save and restart the VM.
To detach, remove the NIC from the same screen. The NIC resource remains after detachment and can be reattached to a different VM.
Attaching a public IP
Public IPs attach to a VM via the NIC. See Public IP for the detailed procedure.
IP forwarding
By default, a NIC drops packets whose destination IP does not match its own IP. To use a VM as a NAT gateway, software router, or VPN appliance—relaying traffic bound for other destinations—you must enable IP forwarding.
- When enabled, the NIC can send and receive packets that are not addressed to its own IP.
- Configure it under the IP forwarding field when creating the NIC.
- You must also enable kernel IP forwarding inside the VM's OS for packets to actually route (e.g.
net.ipv4.ip_forward=1on Linux).
IP forwarding lets the NIC pass traffic with arbitrary source and destination addresses. Enable it only when necessary, and restrict traffic with Firewall rules.
Managing NICs
The Network > Network Interfaces list shows:
| Column | Description |
|---|---|
| Name | NIC identifier |
| IP / MAC | Assigned private IP and MAC |
| Attached VM | The VM it's attached to (blank if unattached) |
| Subnet | The subnet it belongs to |
| Status | Active / Deleted |
To delete a NIC, detach it from both the public IP and the VM first, then remove it.
A network interface registered as a server in a load balancer rule cannot be deleted. The same applies when deleting a VM together with its network interfaces. Remove the server from the load balancer rule or delete the load balancer first.