Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex BareMetal
    • All guides
    • Overview
    • Integrating with other Yandex Cloud services
      • Overview
      • Stock server configurations
      • Custom server configuration
      • On-request server configuration
      • Overview
      • Public network
      • Private network
      • DHCP
      • MC-LAG
      • Restrictions in BareMetal networks
      • Overview
      • Images
      • Access management
      • Additional server settings
      • Management console
      • Monitoring metrics
    • Quotas and limits
    • All tutorials
    • Connecting an existing BareMetal server to Cloud Backup
    • Configuring VRRP for a cluster of BareMetal servers
    • Establishing network connectivity in a BareMetal private subnet
    • Manually assigning a public IP address to a BareMetal server
    • Establishing network connectivity between BareMetal and Virtual Private Cloud private subnets
    • Establishing network connectivity between a BareMetal private subnet and on-premise resources
    • Delivering USB devices to a BareMetal server or virtual machine
    • Configuring an OPNsense firewall in high availability cluster mode
    • Deploying a web app on BareMetal servers with an L7 load balancer and Smart Web Security protection
    • Connecting a BareMetal server as an external node to a Managed Service for Kubernetes cluster
    • Configuring DNS connectivity between Yandex BareMetal and Yandex Virtual Private Cloud to access Managed Service for PostgreSQL via FQDN
  • Pricing policy
  • FAQ

In this article:

  • Getting started
  • Required paid resources
  • Order a dedicated public subnet
  • Rent a BareMetal server
  • Obtain the public subnet parameters
  • Connect to the server via the KVM console
  • Identify the public network interface
  • Assign a static public IP address to the network interface
  • Test network connectivity
  • How to cancel a rent
  1. Tutorials
  2. Manually assigning a public IP address to a BareMetal server

Manually assigning a public IP address to a BareMetal server

Written by
Yandex Cloud
Updated at July 24, 2026
View in Markdown
  • Getting started
    • Required paid resources
  • Order a dedicated public subnet
  • Rent a BareMetal server
  • Obtain the public subnet parameters
  • Connect to the server via the KVM console
  • Identify the public network interface
  • Assign a static public IP address to the network interface
  • Test network connectivity
  • How to cancel a rent

There is no DHCP server in the dedicated public subnet of BareMetal servers. Therefore, on the network interface of the server connected to such a subnet, you should manually set a static public IP address from the subnet address range, plus specify the default gateway address and DNS servers.

The information about the range of IP addresses available in a public subnet and default gateway is provided in the Network interfaces section on the server information page and on the public subnet information page.

Note

The steps described in this guide also apply to the ephemeral public subnet if its DHCP server was off when the server was rented. The ephemeral public subnet is always /31 in size and consists of these two addresses: the first one is the default gateway address, and the second one is the server's public IP address. For more information, see DHCP in an ephemeral public subnet.

For Windows servers, you have to manually assign a public IP address in any ephemeral /31 public subnet, even if its DHCP server is on. This is because the Windows DHCP client cannot issue addresses in /31 subnets.

To learn more about networks in Yandex BareMetal, see Network.

In this guide, you will learn how to manually configure a public IP address on the network interface of a BareMetal server connected to a dedicated public subnet. This example uses servers running Ubuntu 24.04 LTS, AlmaLinux 9, and Windows Server 2022. If using another OS, you will follow the same steps, but the way you configure network interfaces may differ. For network interface configuration steps in other operating systems, refer to the relevant OS guides.

To assign a public IP address to a BareMetal server manually:

  1. Get your cloud ready.
  2. Order a dedicated public subnet.
  3. Rent a BareMetal server.
  4. Obtain the public subnet parameters.
  5. Connect to the server via the KVM console.
  6. Identify the public network interface.
  7. Assign a static public IP address to the network interface.
  8. Test network connectivity.

See also How to cancel a server rent.

Getting startedGetting started

Sign up for Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or create a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can create or select a folder for your infrastructure on the cloud page.

Learn more about clouds and folders here.

Required paid resourcesRequired paid resources

The cost of the proposed solution includes:

  • Fee for renting a BareMetal server.
  • Fee for renting a Yandex BareMetal dedicated public subnet.

For more information, see Yandex BareMetal pricing.

Warning

The minimum rent period for a dedicated public subnet is one month from the order date. You cannot delete such a subnet during the first month after ordering it.

Order a dedicated public subnetOrder a dedicated public subnet

Order a dedicated public subnet of size /29 in the ru-central1-m3 server pool:

Management console
  1. In the management console, select the folder where you are going to create your infrastructure.
  2. Navigate to BareMetal.
  3. In the left-hand panel, select  Public addresses and subnets.
  4. At the top right, click Order a public subnet.
  5. In the Availability zone field, select the availability zone where the subnet will be available.
  6. In the Pool field, select the ru-central1-m3 server pool.
  7. In the subnet size field, select /29.
  8. In the Name field, enter the subnet name: my-public-subnet.
  9. Click Order.

For more information on renting a public subnet, see this section.

Rent a BareMetal serverRent a BareMetal server

Management console
  1. In the management console, select the folder where you are deploying your infrastructure.

  2. Navigate to BareMetal.

  3. Click Lease server and, in the window that opens, select Stock configurations and a suitable BareMetal server configuration in the ru-central1-m3 server pool.

    Do it by selecting the ru-central1-m3 server pool in the filter on the right side of the window, under Pool.

    To select the suitable server configuration, click the section with its name in the central part of the screen.

    Tip

    You can reduce the cost of renting a server in some configurations by ordering server assembly.

    To use the discount, hover over Cheaper with assembly under the configuration at hand and click Go to assembly in the pop-up window.

    When ordering a server with assembly, follow the steps below to configure the server properties. In this case, the server will not be available immediately, but only after the assembly is completed (within four calendar days), and at a lower price.

  4. In the server configuration window that opens:

    1. In the Lease duration field, select the lease period: 1 day, 1 month, 3 months, 6 months, or 1 year.

      When this period expires, server lease will automatically be renewed for the same period. You cannot terminate the lease during the specified lease period, but you can refuse to extend the server lease further.

    2. Under Image, select the image of the operating system you will be configuring the network interface in (Ubuntu 24.04, AlmaLinux 9, or Windows Server 2022).

    3. Optionally, under Disk, configure disk partitioning:

      1. Click Configure disk layout.

      2. Specify partition settings. To create a new partition, click Add partition.

        To configure RAID arrays and disk partitions by yourself, click Remove RAID.

      3. Click Save.

    4. Under Network interfaces:

      1. In the Public address field, select From a dedicated subnet.
      2. In the public subnet selection field that appears, specify the previously created my-public-subnet.
    5. Under Access:

      1. In the Password field, select one of the following options to create a root password:

        • To generate a new root password, select New password and click Generate.

          Warning

          This option requires you to maintain password security. Save the password you generated in a secure location. Yandex Cloud does not store it, and you will not be able to retrieve it once the server is deployed.

        • To use the root password saved in a Yandex Lockbox secret, select Lockbox secret.

          In the Name, Version, and Key fields, select the secret containing your password, its version, and its key, respectively.

          If you do not have a Yandex Lockbox secret, click Create to create it.

          Choose the Custom secret type to specify a custom password or Generated to generate password automatically.

      2. In the Public SSH key field, select the SSH key saved in your organization user profile.

        If there are no SSH keys in your profile or you want to add a new key:

        1. Click Add key.

        2. Enter a name for the SSH key.

        3. Select one of the following:

          • Enter manually: Paste the contents of the public SSH key. You need to create an SSH key pair on your own.

          • Load from file: Upload the public part of the SSH key. You need to create an SSH key pair on your own.

          • Generate key: Automatically create an SSH key pair.

            When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the /home/<user_name>/.ssh directory. In Windows, unpack the archive to the C:\Users\<user_name>/.ssh directory. You do not need additionally enter the public key in the management console.

        4. Click Add.

        The system will add the SSH key to your organization user profile. If the organization has disabled the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.

    6. Under Server information, in the Name field, enter the server name: my-server.

    7. Click Lease server.

Note

Server setup and OS installation may take up to 45 minutes. The server will have the Provisioning status during this time. After OS installation is complete, the server status will change to Ready.

Obtain the public subnet parametersObtain the public subnet parameters

Before configuring the network interface, find out the parameters of the dedicated public subnet the server is connected to: CIDR, default gateway address, and range of available public IP addresses.

  1. In the management console, select the folder where you are deploying your infrastructure.

  2. Navigate to BareMetal.

  3. In the left-hand panel, select Public addresses and subnets and open the my-public-subnet information page.

  4. Write down the CIDR values, default gateway address, and range of available public IP addresses.

    For a subnet of size /29 (eight IP addresses in CIDR):

    • The first IP address in the range is the subnet address.
    • The second IP address in the range is the default gateway address.
    • From the third to second-last one are addresses available for server network interfaces.
    • The last IP address in the range is the broadcast (broadcast) address.

    For example, if the subnet CIDR is 198.51.100.104/29:

    • Subnet IP address: 198.51.100.104.
    • Default gateway IP address: 198.51.100.105.
    • Available addresses: From 198.51.100.106 to 198.51.100.110.
    • Broadcast address: 198.51.100.111.

    These values ​​will be used in example commands further on in this guide. Replace them with the values you got for your subnet.

Connect to the server via the KVM consoleConnect to the server via the KVM console

Before you configure a public IP address, the server is not accessible from the Internet, so you will not be able to connect to it via SSH or RDP. To connect to the server, use the KVM console.

  1. In the management console, select the folder where you are deploying your infrastructure.

  2. Navigate to BareMetal.

  3. Next to my-server, click and select KVM console.

    A window with a KVM console terminal will open.

    If the terminal does not appear, try restarting the server.

  4. Authenticate to the server using the administrator password saved when renting the server (root for Linux, Administrator for Windows).

    Tip

    To paste clipboard text to the KVM console, use the Paste text here field in the upper right corner.

    If you did not save the administrator password, you can create a new one as per this guide or reinstall the server OS.

For more on connecting to a server via the KVM console, see this section.

Identify the public network interfaceIdentify the public network interface

To figure out which of the server's network interfaces is connected to the public network, match the interface name against the MAC address listed in the management console on the server info page under Network interfaces

Write down the MAC address of the public network interface: you will need it for configuration.

Ubuntu/Debian/AlmaLinux
Windows Server

In the KVM console terminal, run this command:

ip a

Result:

...
2: etx1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:25:90:c8:03:f8 brd ff:ff:ff:ff:ff:ff
    altname enp2s0f0
    inet6 fe80::225:90ff:fec8:3f8/64 scope link
        valid_lft forever preferred_lft forever
3: etx2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:25:90:c8:03:f9 brd ff:ff:ff:ff:ff:ff
    altname enp2s0f1
    inet6 fe80::225:90ff:fec8:3f9/64 scope link
        valid_lft forever preferred_lft forever
...

In this example, the public MAC address from the management console is 00:25:90:c8:03:f9, so the server's public network interface is eth2.

In PowerShell, run:

Get-NetAdapter | Format-Table Name, InterfaceDescription, MacAddress, Status

Result:

Name       InterfaceDescription                          MacAddress         Status
----       --------------------                          ----------         ------
Ethernet   Mellanox ConnectX-4 Lx Adapter #1             00-25-90-C8-03-F8  Up
Ethernet 2 Mellanox ConnectX-4 Lx Adapter #2             00-25-90-C8-03-F9  Up

In this example, the public MAC address from the management console is 00:25:90:c8:03:f9, so the server's public network interface is Ethernet 2.

Warning

If the rented server supports MC-LAG and is installed from a custom image, the physical network interfaces are not automatically combined into aggregation groups. In which case we recommend to start by configuring an aggregation group for a pair of public interfaces and then assign a static public IP address to the bond interface. In the bond interface settings, you should specify the MAC address of one of the physical interfaces of the aggregation group as the MAC address.

Assign a static public IP address to the network interfaceAssign a static public IP address to the network interface

Ubuntu/Debian (Netplan)
AlmaLinux/RHEL/CentOS (NetworkManager)
Windows Server (GUI)
Windows Server (PowerShell)
  1. In the KVM console terminal, learn the name of the Netplan configuration file:

    ls /etc/netplan/
    

    Result:

    50-cloud-init.yaml
    
  2. Open the configuration file:

    nano /etc/netplan/50-cloud-init.yaml
    
  3. Update the public network interface settings:

    network:
      version: 2
      ethernets:
        ... # This example shows only the public interface configuration.
        etx2:
          match:
            macaddress: "00:25:90:c8:03:f9"
          dhcp4: false # Disable DHCP on the interface
          set-name: "etx2"
          addresses: # Set a static public IP address and subnet mask
            - 198.51.100.106/29
          routes: # Set the default route through the public subnet gateway
            - to: default
              via: 198.51.100.105
          nameservers: # Set DNS servers
            addresses: [77.88.8.8, 77.88.8.1]
    

    Where:

    • match.macaddress: MAC address of the public network interface.
    • dhcp4: false disables DHCP on the interface.
    • addresses: Public IP address from the range of available subnet addresses, with the subnet mask in CIDR format.
    • routes.to: default and via: Default route through the public subnet gateway address.
    • nameservers.addresses: DNS server addresses.

    To save the changes and exit the text editor, press Ctrl + X and confirm saving changes to the 50-cloud-init.yaml file.

  4. Make sure the configuration is correct:

    netplan try
    

    If the configuration is free of errors, the utility will temporarily apply it and prompt you to confirm the changes. Confirm the changes by pressing ENTER.

  5. Apply the new configuration:

    netplan apply
    

To configure the network interface, use nmcli. You can also use the nmtui graphical utility, which provides an interactive text interface to go with NetworkManager.

  1. View the list of network connections in the KVM console terminal:

    nmcli connection show
    

    Result:

    NAME         UUID                                  TYPE      DEVICE
    System etx1  5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03  ethernet  etx1
    System etx2  5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e04  ethernet  etx2
    

    Find the connection name for the public network interface. In this example, System etx2.

  2. Set a static public IP address, default gateway, and DNS servers for the connection:

    nmcli connection modify "System etx2" \
      ipv4.method manual \
      ipv4.addresses 198.51.100.106/29 \
      ipv4.gateway 198.51.100.105 \
      ipv4.dns "77.88.8.8 77.88.8.1" \
      connection.autoconnect yes
    

    Where:

    • ipv4.method manual: Disables DHCP and switches the connection to static configuration mode.
    • ipv4.addresses: Public IP address from the range of available subnet addresses, with the subnet mask in CIDR format.
    • ipv4.gateway: Public subnet gateway address.
    • ipv4.dns: DNS server addresses separated by spaces.
    • connection.autoconnect yes: Automatically activates the connection on system boot.
  3. Activate the connection:

    nmcli connection up "System etx2"
    
  1. In the KVM console, go Start → Control Panel → Network and Internet → Network and Sharing Center.

  2. In the left-hand panel, select Change adapter settings.

  3. In the list that opens, find the network adapter matching the public network interface, e.g., Ethernet 2, right-click it and select Properties.

  4. In the list of connection components, select Internet Protocol Version 4 (TCP/IPv4) and click Properties.

  5. Select Use the following IP address and fill out the fields:

    • IP address: Public IP address from the range of available subnet addresses, e.g., 198.51.100.106.
    • Subnet mask: Subnet mask matching the CIDR notation, e.g., /29: 255.255.255.248.
    • Default gateway: Public subnet gateway address, e.g., 198.51.100.105.
  6. Select Use the following DNS server addresses and fill out the fields:

    • Preferred DNS server: 77.88.8.8.
    • Alternate DNS server: 77.88.8.1.
  7. Click OK in both windows to save the settings.

In the PowerShell terminal in the KVM console:

  1. Remove the existing IPv4 configuration on the public network interface if you got it over DHCP:

    Set-NetIPInterface -InterfaceAlias "Ethernet 2" -Dhcp Disabled
    Remove-NetIPAddress -InterfaceAlias "Ethernet 2" -AddressFamily IPv4 -Confirm:$false
    Remove-NetRoute -InterfaceAlias "Ethernet 2" -AddressFamily IPv4 -Confirm:$false
    
  2. Set a static public IP address and default gateway:

    New-NetIPAddress -InterfaceAlias "Ethernet 2" `
      -IPAddress 198.51.100.106 `
      -PrefixLength 29 `
      -DefaultGateway 198.51.100.105
    

    Where:

    • -InterfaceAlias: Name of the public network interface.
    • -IPAddress: Public IP address from the range of available subnet addresses.
    • -PrefixLength: Subnet mask prefix length (for /29: 29).
    • -DefaultGateway: Public subnet gateway address.
  3. Set DNS servers for the interface:

    Set-DnsClientServerAddress -InterfaceAlias "Ethernet 2" `
      -ServerAddresses ("77.88.8.8","77.88.8.1")
    

Test network connectivityTest network connectivity

Make sure the network interface got a public IP address and the server has access to the internet.

Ubuntu/Debian/AlmaLinux
Windows Server
  1. Check that the specified IP address has been assigned to the network interface:

    ip a | grep etx2
    

    Result:

    3: etx2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        inet 198.51.100.106/29 brd 198.51.100.111 scope global etx2
    
  2. Check the route table:

    ip r
    

    Result:

    default via 198.51.100.105 dev etx2 proto static
    198.51.100.104/29 dev etx2 proto kernel scope link src 198.51.100.106
    
  3. Check the DNS settings:

    resolvectl status
    
  4. Check internet connectivity:

    ping ya.ru -c 5
    

    Result:

    PING ya.ru (77.88.55.88) 56(84) bytes of data.
    64 bytes from ya.ru (77.88.55.88): icmp_seq=1 ttl=55 time=3.45 ms
    64 bytes from ya.ru (77.88.55.88): icmp_seq=2 ttl=55 time=3.22 ms
    ...
    
    --- ya.ru ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4006ms
    rtt min/avg/max/mdev = 3.215/3.337/3.452/0.085 ms
    
  1. In PowerShell, check that the specified IP address has been assigned to the network interface:

    Get-NetIPAddress -InterfaceAlias "Ethernet 2" -AddressFamily IPv4
    
  2. Check the route table:

    Get-NetRoute -InterfaceAlias "Ethernet 2" -AddressFamily IPv4
    
  3. Check the DNS settings:

    Get-DnsClientServerAddress -InterfaceAlias "Ethernet 2"
    
  4. Check internet connectivity:

    Test-NetConnection ya.ru -InformationLevel Detailed
    

Once a public IP address is assigned, you can connect to the server from the internet via that IP address using SSH (for Linux) or RDP (for Windows).

How to cancel a rentHow to cancel a rent

You cannot delete a BareMetal server or a dedicated public subnet. Instead, you can choose not to renew their rent.

To stop paying for the resources you created:

  1. Cancel rent renewal for the BareMetal server you created earlier.
  2. After the minimum rent period (one month from the order date) has expired, delete the dedicated public subnet.

See alsoSee also

  • Public network
  • DHCP in a Yandex BareMetal network
  • Ordering a dedicated public subnet
  • Configuring the MC-LAG aggregation group
  • Establishing network connectivity in a Yandex BareMetal private subnet

Was the article helpful?

Previous
Establishing network connectivity in a BareMetal private subnet
Next
Establishing network connectivity between BareMetal and Virtual Private Cloud private subnets
© 2026 Direct Cursus Technology L.L.C.