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 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 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
Add a port to a private subnet or global router subnet
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab Private networks.
-
Open the network page → 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
;<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 a public subnet
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab Public networks.
-
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>
— ID or name of the public network, matches the parameter<subnet>
can be viewed with the commandopenstack subnet list
;<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 page → tab Ports.
- 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 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 of the control panel, use the following instructions Public IP addresses.
Control panel
OpenStack CLI
- В control panels go to Cloud platform → Network.
- Open the tab Private networks.
- Open the network page → tab Ports.
- In the port card of the cloud server or load balancer, next to the public IP address, click .
- Select Disable public IP address.
- Optional: If you no longer need the public IP address, check the checkbox. Delete address.
- Click Save.
-
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
Enable a port on the private subnet or global router subnet
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab Private networks.
-
Open the network page → tab Ports.
-
In the port card, 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.
Enable a port on a public subnet
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab Public networks.
-
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
Disable a port on the private subnet or global router subnet
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab Private networks.
-
Open the network page → tab Ports.
-
In the port card, 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.
Disable a port on a public subnet
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab Public networks.
-
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
Delete a port on a private subnet or global router subnet
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab Private networks.
-
Open the network page → tab Ports.
-
In the port card, click .
If the button inactive, port connected prohibition device. Remove this device and return to step 1.
Use the instructions to remove the device:
-
Click Delete.
-
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.
Delete a port on a public subnet
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Network.
-
Open the tab Public networks.
-
Open the subnet card → tab Ports.
-
On the port line, click .
-
Click Delete.
-
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.