Ports
A port is a virtual network card to which a mapping of MAC address and IP address is assigned.An IP address is assigned to a port within the subnet in which the port resides.
Ports are used to connect devices to private subnets, global router subnets, and public subnets.If you disconnect a port from a device, it will also be disconnected from the subnet. A private subnet cannot be deleted if it has at least one port.
You can work with ports in the control panel, using the OpenStack CLI or Terraform.
In cloud networks, service ports are automatically created and management is not available:
- two DHCP ports on a private subnet. Created when DHCP is enabled on the subnet, deleted when DHCP is disabled;
- three service ports on the global router subnet for network equipment. Created when the private network is connected to the global router, deleted when the private network is disconnected from the global router or when the global router is removed;
- VRRP ports and downlinks on the private subnets where the load balancer resides. The number of service ports depends on the type of load balancer, see Load Bal ancer Ports for details;
- port on the private subnet where the file storage is located. Created together with the subnet for the file storage, can be deleted only with the storage.
Add a port to a subnet
Private subnet, global router subnet
Public subnet
Control panel
OpenStack CLI
-
In the dashboard, on the top menu, click Products and select Cloud Servers.
-
Go to Network → Private Networks tab.
-
Open the Network page → Ports tab.
-
Click Add Port.
-
Select a subnet.
-
Enter the IP address of the port.
-
Optional: select the server or Managed Kubernetes cluster node to which you want to add this port.
-
Click Add Port.
-
Create a port on the subnet:
openstack port create \
--network <network> \
--fixed-ip subnet=<subnet>,ip-address=<port_ip_address> \
<port_name>Specify:
<network>
— The ID or name of the private network, the global router network, can be viewed with the commandopenstack network list
;<subnet>
— The ID or subnet name can be viewed with the commandopenstack subnet list
;<port_ip_address>
— The IP address of the port;<port_name>
— port name.
Control panel
OpenStack CLI
-
In the dashboard, on the top menu, click Products and select Cloud Servers.
-
Go to Network → Public Networks tab.
-
Open the subnet card → Ports tab.
-
Click Add Port.
-
Select a subnet.
-
Enter the IP address of the port.
-
Click Add Port.
-
Create a port on the subnet:
openstack port create \
--network <network> \
--fixed-ip subnet=<subnet>,ip-address=<port_ip_address> \
<port_name>Specify:
<network>
— ID or name of the public network, matches the parameter<subnet>
can be viewed with the commandopenstack subnet list
;<subnet>
— The ID or subnet name can be viewed with the commandopenstack subnet list
;<port_ip_address>
— The IP address of the port;<port_name>
— port name.
Add a cloud server or Managed Kubernetes cluster node to the subnet via port
A cloud server can be added to a private subnet, a global router subnet, or a public subnet after server creation. The Managed Kubernetes cluster node can be added to a private subnet or a global router subnet.
To do this, you need to add a port to the server or node.
Control panel
OpenStack CLI
- In the dashboard, on the top menu, click Products and select Cloud Servers.
- Go to the Servers section.
- Open the server page → Ports tab.
- Click Add Port.
- Select private subnet, global router subnet, or public subnet.
- Enter the IP address of the port.
- Click Add.
-
Create a port on the subnet:
openstack port create \
--network <network> \
--fixed-ip subnet=<subnet>,ip-address=<port_ip_address> \
<port_name>Specify:
<network>
— The ID or name of a private subnet, global router subnet, or public subnet can be viewed with the commandopenstack network list
. For a public subnet it is the same as the parameter<subnet>
;<subnet>
— The ID or subnet name can be viewed with the commandopenstack subnet list
;<port_ip_address>
— The IP address of the port;<port_name>
— port name.
-
Add a port to the cloud server:
openstack server add port <server> <port>
Specify:
<server>
— The ID or name of the cloud server can be viewed with the commandopenstack server list
;<port>
— The port ID or name can be viewed with the commandopenstack port list
.
Connect a public IP address to a port on a private subnet
If a cloud server or load balancer is connected to a port on the private subnet, you can connect a public IP address to the port.
To connect a public IP address in the device sections of the Control Panel, use the Public IP Addresses instructions.
Control panel
OpenStack CLI
- Make sure the device is on a subnet that meets the requirements. To prepare the subnet, use the instructions Prepare a private subnet to connect a public IP address.
- In the dashboard, on the top menu, click Products and select Cloud Servers.
- Go to Network → Private Networks tab.
- Open the Network page → Ports tab.
- In the port card of the cloud server or load balancer, click Connect Public IP.
- Select a public IP address.
- Click Connect.
-
Connect a public IP address to the port:
openstack floating ip set --port <port> <public_ip_address>
Specify:
<port>
— The port ID of a cloud server or load balancer can be viewed with the commandopenstack port list
;<public_ip_address>
— ID, or public IP address, can be viewed with the commandopenstack floating ip list
.