Ports
A port is a virtual network card to which a mapping of a MAC address and a private IP address is assigned from a subnet. The IP address is assigned to the port within the subnet in which the port is located.
Ports are used to connect devices to private subnets, global router subnets, and public subnets. If a port is disconnected from a device, it will also be disconnected from a subnet. A private subnet cannot be deleted if it has at least one port.
You can work with ports in control panels with the help of 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 Enable DHCP on a subnet are removed at disabling DHCP;
- three service ports on the global router subnet for network equipment. Created when connecting a private network to a global router are removed at disconnecting the private network from the global router or at removing the global router;
- 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 the following for details load balancer ports;
- port on the private subnet on which it resides file storage. Created with the subnet for file storage, can be deleted with storage only.
Add a port to a subnet
A port can be added to a private subnet, a global router subnet, or a public subnet.
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab depending on which subnet you want to add the port to:
- for a private subnet or a global router subnet — Private networks;
- for the public subnet-- Public subnets.
-
Open the subnet card → tab Ports.
-
Click Add a port.
-
Select a subnet.
-
Enter the IP address of the port.
-
Click Add a 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
. For a public subnet it is the same as the parameter<subnet>
;<subnet>
— ID or subnet name, can be viewed with the commandopenstack subnet list
;<port_ip_address>
— 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
- В control panels go to Cloud platform → Servers.
- Open the server page → tab Ports.
- Click Add a port.
- Select private subnet, global router subnet, or public subnet.
- Enter the IP address of the port.
- Click Add a 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 a private subnet, global router subnet, or public subnet can be viewed using the commandopenstack network list
. For a public subnet it is the same as the parameter<subnet>
;<subnet>
— ID or subnet name, can be viewed with the commandopenstack subnet list
;<port_ip_address>
— 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 using the commandopenstack server list
;<port>
— ID or port 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 a private subnet, you can connect to the port by public IP address.
To connect a public IP address in the device sections of the control panel, use the following instructions Public IP addresses.
Control panel
OpenStack CLI
- Make sure the device is on a subnet that meets the requirements. Use the instructions to prepare the subnet Prepare a private subnet to connect a public IP address.
- В control panels go to Cloud platform → Network.
- Open the tab Private networks.
- Open the network card → tab Ports.
- In the cloud server or load balancer port row in the column Public IP click Connect.
- Select a public IP address.
-
Connect a public IP address to the port:
openstack floating ip set --port <port> <public_ip_address>
Specify:
<port>
— The port ID of the cloud server or load balancer, can be viewed using the commandopenstack port list
;<public_ip_address>
— ID or public IP address, can be viewed with the commandopenstack floating ip list
Disconnect a public IP address from a port on a private subnet
To disable the public IP address in the device sections in the control panel, use the following instructions Public IP addresses.
Control panel
OpenStack CLI
- Make sure the device is on a subnet that meets the requirements. Use the instructions to prepare the subnet Prepare a private subnet to connect a public IP address.
- В control panels go to Cloud platform → Network.
- Open the tab Private networks.
- Open the network card → tab Ports.
- In the cloud server or load balancer port row in the column Public IP on the menu of the public IP address, select Disable public IP.
- Select a public IP address.
-
Disconnect the public IP address from the port:
openstack floating ip unset --port <public_ip_address>
Specify
<public_ip_address>
— ID or public IP address, can be viewed with the commandopenstack floating ip list
Enable port
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab depending on which subnet you want to enable the port for:
- for a private subnet or a global router subnet — Private networks;
- for the public subnet-- Public subnets.
-
Open the subnet card → tab Ports.
-
In the port line, enable the port.
-
Look at the list of ports in the subnet and copy the ID or name of the desired port:
openstack port list --fixed-ip subnet=<subnet>
Specify
<subnet>
— ID or subnet name, can be viewed with the commandopenstack subnet list
-
Turn on the port:
openstack port set --enable <port>
Specify
<port>
— ID or port name that you copied in step 2.
Disable the port
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab depending on which subnet you want to disable the port for:
- for a private subnet or a global router subnet — Private networks;
- for the public subnet-- Public subnets.
-
Open the subnet card → tab Ports.
-
In the port row, disable the port.
-
Look at the list of ports in the subnet and copy the ID or name of the desired port:
openstack port list --fixed-ip subnet=<subnet>
Specify
<subnet>
— ID or subnet name, can be viewed with the commandopenstack subnet list
-
Disconnect the port:
openstack port set --disable <port>
Specify
<port>
— ID or port name that you copied in step 2.
Delete port
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab depending on which port from which subnet you want to remove:
- for a private subnet or a global router subnet — Private networks;
- for the public subnet-- Public subnets.
-
Open the subnet card → tab Ports.
-
On the port line, click .
-
If it is a private subnet port and the button inactive, port connected prohibition device. Remove this device and return to step 1.
Use the instructions to remove the device:
-
Look at the list of ports in the subnet and copy the ID or name of the desired port:
openstack port list --fixed-ip subnet=<subnet>
Specify
<subnet>
— ID or subnet name, can be viewed with the commandopenstack subnet list
-
Delete the port:
openstack port delete <port>
Specify
<port>
— ID or port name that you copied in step 2.