Skip to main content

Change network settings on a dedicated server

Change network settings via Rescue

  1. Boot the server in Rescue recovery and diagnostic mode.

  2. Mount the OS file system.

  3. Check the configuration file name of the netplan utility:

    ls /etc/netplan/

    The response will show the configuration file name. For example:

    01-netcfg.yaml

    Copy the configuration file name.

  4. Open the configuration file of the netplan utility with the text editor vi:

    vi /etc/netplan/<file_name>

    Specify <file_name> — the configuration file name that you copied in step 3.

  5. For the desired interface, change the values of addresses and gateway4 to the new IP address and gateway.

    The configuration file is written in YAML, which is sensitive to tabs and spaces. Fill it out similarly to how it was populated before.

    Example configuration file
    network:
    version: 2
    renderer: networkd
    ethernets:
    eth0:
    dhcp4: no
    addresses: [178.132.202.35/28]
    gateway4: 178.132.202.33
    nameservers:
    addresses: [188.93.16.19, 188.93.17.19]

    Where:

    • eth0 — network interface name;
    • addresses: [178.132.202.35/28] — server IP address with subnet mask;
    • gateway4: 178.132.202.33 — subnet gateway.
  6. Press ESC.

  7. Exit the vi text editor saving changes:

    :wq
  8. Check the configuration file for errors and apply the configuration:

    netplan --debug generate
    netplan apply
  9. In the Control panel, in the top menu, click Products and select Dedicated Servers.

  10. In the Servers section, open the server page → Ports tab.

  11. In the Internet port row, click .

  12. In the VLAN field, replace the value Shared with the value of the dedicated VLAN. You can view the VLAN of a dedicated subnet in the Control panel: in the top menu, click Products → Dedicated Servers → Network → Subnets tab.

  13. Click Configure.

  14. Restore the previous server boot template or reboot the server from the OS. When rebooting the server from the OS, the boot template will automatically revert to the one that was set before changing the server boot template.

Change network settings via WinPE

Network settings can be restored if in the network interface settings you:

  • clicked to obtain an address via DHCP;
  • configured an incorrect IP address.

Restoring network settings to access Windows Server is done through the registry. Before making changes, gain access to the registry from WinPE and back up the partition where the system and registry files are located, usually C:\Windows\System32\config\SYSTEM.

  1. Boot the server in WinPE recovery and diagnostic mode.

  2. Open cmd.

  3. Display information about network interface settings:

    ipconfig /all
  4. Remember or copy the value of the description field for the desired interface.

  5. Open Registry Editor:

    regedit
  6. Mount the hive with the system and registry files under HKEY_LOCAL_MACHINE:

    6.1. Select the HKEY_LOCAL_MACHINE key.

    6.2. In the File menu, select Load hive.

    6.3. In the dialog box, select the directory where the system and registry files are located, usually C:\Windows\system32\config\SYSTEM.

    6.4. Enter a hive name under which it will be mounted to the HKEY_LOCAL_MACHINE key, for example, MountedSYSTEM. The hive name must not match existing hives in HKEY_LOCAL_MACHINE.

    6.5. Click Open. The registry hive will appear in the key.

  7. In the mounted hive, find the desired network interface:

    7.1. Expand the network interface registry key:

    HKEY_LOCAL_MACHINE\<branch_name>\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}

    Specify <branch_name> — the hive name that you entered in step 6.4.

    The list will contain network interfaces from address 0000 to 0013.

    7.2. Find the interface that has the DriverDesc parameter value specifying the description from step 4.

    7.3. Save the value of the NetCfgInstanceId field.

  8. Change the interface parameter values:

    8.1. Go to the registry key of the network interface you selected in step 7:

    HKEY_LOCAL_MACHINE\<branch_name>\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\<net_cfg_instance_id>

    Specify:

    • <branch_name> — the hive name that you entered in step 6.4;
    • <net_cfg_instance_id> — value of the NetCfgInstanceId field that you obtained in step 7.3.

    8.2. Edit the parameter values. Correct values can be viewed in the Control panel: in the top menu, click Products → Dedicated Servers → server page → Network tab → click the desired subnet.

    • DefaultGateway — default gateway;
    • IPAddress — network interface IP address;
    • NameServer — comma-separated DNS server IP addresses, for example, 8.8.8.8, 8.8.4.4;
    • SubnetMask — subnet mask;
    • EnableDHCP — IP address acquisition mode, enter the value:
      • 0 — if you are not using DHCP;
      • 1 — if you are using DHCP.
  9. Unload the hive: to do this, select it and, in the File menu, select Unload hive.

  10. Restore the previous server boot template or reboot the server from the OS. When rebooting the server from the OS, the boot template will automatically revert to the one that was set before changing the server boot template.