Skip to main content
Update network settings on devices in the subnetwork
Last update:

Update network settings on devices in the subnetwork

If you have changed the network settings (DNS servers, default gateway, static routes) private subnet that has devices on it, you must update the network settings on all devices in the subnet to apply the settings.

Update network settings on the cloud server

If you first changed the network settings of the private subnet (DNS servers, default gateway, static routes), and then created cloud servers in it, all settings on the servers will be automatically prescribed.

If you first created the cloud servers and then changed the subnet network settings to apply the settings:

  1. Check DHCP on the private subnet.
  2. Apply the new network settings on the cloud server.
  3. Modify the cloud server network configuration files.

Check DHCP on the private subnet

  1. In control panels go to Cloud platformNetwork.
  2. Open the tab Private networks.
  3. Open the network page → tab Subnetworks.
  4. In the subnet card, expand the block Automatic network settings.
  5. Check whether the toggle switch is on or off DHCP server.

Apply the new network settings to the cloud server

If DHCP is enabled

Apply the new network settings depending on the DHCP client:

  • re-request information from the DHCP server on the cloud server — the new network settings will be added, but the old ones will not be deleted:

    dhclient <interface_name>

    Specify <interface_name> — interface name, e.g. eth0;

  • or turn off, then turn on the port and re-request information from the DHCP server on the cloud server — the new network settings will be added, while the old ones will be deleted:

    INTERFACE=<interface_name>; ip link set $INTERFACE down && ip link set $INTERFACE up && dhclient $INTERFACE

    Specify <interface_name> — interface name, e.g. eth0.

If DHCP is turned off

If DHCP is disabled on the private subnet, the algorithm for applying new network settings depends on the presence of a cloud-init or cloudbase-init agent in the images from which the cloud server is created. The agents are pre-installed in all ready-made images cloud platform. Agents must be installed if you uploaded an image to the Selectel image repository on your own following the instructions below Prepare ISO image to work with the cloud platform.

  1. In control panels go to Cloud platformServers.
  2. Open the cloud server page → tab Ports.
  3. If in the block Configuring ports parameter When the server reboots, perform a hardware reboot of the server.
  4. If in the block Configuring ports parameter Manually in the network configuration file, modify the network configuration file of the cloud server.

modify the cloud server network configuration file

You must modify the cloud server network configuration file if DHCP is disabled on the private subnet and:

  • cloud server is created from an image without cloud-init or cloudbase-init agent;
  • cloud server is created from an image with cloud-init or cloudbase-init agent, but in block Configuring ports parameter Manually in the network configuration file.

If, in the future. enable DHCP on a private subnet, then the network settings specified in the file will not work — DHCP applies its own settings to all servers.

For your information

These are instructions with examples of changing network settings in the network configuration file: DNS servers, default gateway, static routes. Configuration files and network settings may vary from distribution to distribution.

The configuration depends on the utility that is installed on the cloud server: ifupdown or netplan. In cloud servers created from ready-made images with the Ubuntu 18.04, 20.04, and 22.04 operating systems, by default the ifupdown utility is used to configure the network. You can switch the network configuration from ifupdown to netplan.

  1. Connect to the server.

  2. Open the CLI.

  3. If the cloud server is created from a cloud-init image, the network settings will be synchronized with it and the previous network settings will be specified after the server restarts. To disable synchronization, disable network configuration:

    echo "network: {config: disabled}" >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
  4. Open the network configuration file:

    nano /etc/network/interfaces.d/50-cloud-init.cfg
  5. Change the network settings:

    auto lo
    iface lo inet loopback
    dns-nameservers <dns_server_1> <dns_server_2>

    auto <interface_name>
    iface <interface_name> inet static
    address <ip_address>
    mtu 1500
    post-up route add default gw <gateway> || true
    pre-down route del default gw <gateway> || true
    up route add -net <destination_subnet_ip_address> netmask <destination_subnet_netmask> gw <next_hop_ip_address>

    Specify:

    • <dns_server_1>, <dns_server_2> — DNS servers on the private subnet;
    • <interface_name> — network interface name;
    • <ip_address> — The IP address of the cloud server with the private subnet mask in which it resides. For example, 192.168.0.5/29;
    • <gateway> — default gateway of the private subnet;
    • <destination_subnet_ip_address> — for static routes: the IP address of the destination subnet to which traffic will be routed, e.g. 172.16.0.8;
    • <destination_subnet_netmask> — for static routes: the destination subnet mask, for example, 29;
    • <next_hop_ip_address> — for static routes: next-hop — the IP address through which devices on the source subnet will route traffic to the destination subnet. You can enter any address from the source subnet.

Update network settings on the Managed Kubernetes cluster

If you first changed the network settings of the private subnet (DNS servers, default gateway, static routes) and then create Managed Kubernetes cluster nodes in it, all the settings on the cluster nodes will be written automatically.

If you first created the Managed Kubernetes cluster nodes and then changed the network subnet settings, to apply the settings sequentially shut down all nodes in the cluster and turn them on.

Update network settings on the cloud database cluster

If you first changed the network settings of the private subnet (DNS servers, default gateway, static routes), and then created a cloud database cluster in it, all settings on the cluster will be prescribed automatically.

If you first create a cloud database cluster and then change the network subnet settings. to apply the settings:

  • file a ticket. Specify:
    • Cloud database cluster ID. You can copy it to control panels: under Cloud platformDatabases → in the row of the desired cluster, click ;
    • Project ID. Can be copied to control panels: go to the section Cloud platform → open the project menu (name of the current project) → in the line of the desired project, click ;
    • pool where the subnet is located;
    • new network settings to be applied;
  • or recreate the cloud database cluster, such as restoring it from a backup. For more information, see the subsection Restore a cluster (example for PostgreSQL).

Update network settings on the cloud load balancer

If you first changed the network settings of the private subnet (DNS servers, default gateway, static routes), and then created a cloud load balancer in it, all settings on the load balancer will be automatically prescribed.

If you first created a cloud load balancer and then change the network subnet settings, perform a failover of the load balancer instance to apply the settings. To do this:

  • file a ticket. Specify:
    • Load balancer ID. You can copy it to control panels: under Cloud platformBalancers → tab Balancers → in the card of the desired load balancer, click ;
    • Project ID. Can be copied to control panels: go to the section Cloud platform → open the project menu (name of the current project) → in the line of the desired project, click ;
    • pool where the subnet is located;
    • new network settings to be applied;
    • the desired time to apply the changes;
  • or create a load balancer all over again.

Update the network settings on the file store

If you first changed the network settings of the private subnet (DNS servers, default gateway, static routes), and then created a file storage in it, all settings on the storage will be written automatically.

If you created the file storage first and then changed the network subnet settings, apply the changes.

  1. In control panels go to Cloud platformFile storage.
  2. Open the file storage page → tab Settings.
  3. Click Update network settings.