Skip to main content
Change network settings on a dedicated server

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. Open the netplan utility configuration file with the vi text editor:

    vi /etc/netplan/01-netcfg.yaml

    or

    vi /etc/netplan/50-cloud-init.yaml
  4. For the desired interface, change the addresses and gateway4 values to the new IP address and gateway.

    The configuration file is written in tab- and space-sensitive YAML. Fill it in similarly to how it was filled in earlier.

    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]

    Here:

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

  6. Exit the vi text editor with your changes saved:

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

    netplan --debug generate
    netplan apply
  8. In the Control Panel, on the top menu, click Products and select Dedicated Servers.

  9. In the Servers section, open the Server page → Ports tab.

  10. In the Internet port bar, click .

  11. In the VLAN field, replace the Shared value 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 ProductsDedicated ServersNetworkSubnets tab.

  12. Click Configure.

  13. Revert to the previous server boot pattern or reboot the server from the OS. When you reboot the server from the OS, the boot template will automatically change to the one that was set before the server boot template was changed. the server boot pattern was set before the server boot pattern was changed.

Change network settings via WinPE

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

  • clicked on DHCP address acquisition;
  • configured the wrong IP address.

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

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

  2. Open cmd.

  3. Output information about the settings of the network interfaces:

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

  5. Open the Registry Editor:

    regedit
  6. Mount the branch with the system and registry files to HKEY\_LOCAL\_MACHINE:

    6.1. Highlight the HKEY\_LOCAL\_MACHINE section.

    6.2 From 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\Windows\system32\config\SYSTEM.

    6.4 Enter the name with which the loaded branch will be mounted in HKEY\_LOCAL\_MACHINE and click Open.

  7. In the mounted branch, locate the desired interface:

    7.1 Expand the registry section:

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

    Specify <branch_name> is the branch name you entered in step 6.4.

    The list will list network interfaces from address 0000 through 0013.

    7.2 Find the interface that has the Driver Desc parameter value with the description from step 4. Save the value of the NetCfgInstanceId field.

  8. Change the values of the interface parameters:

    8.1 Go to the registry section:

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

    Specify:

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

    8.2 Edit the parameter values. The correct values can be viewed in the control panel: in the top menu, click ProductsDedicated Servers → Server page → Network tab → click the desired subnet.

    • DefaultGateway;
    • IPAddress;
    • NameServer;
    • SubnetMask.
    • EnableDHCP — enter a value 0 if you are not using DHCP, if you are using — 1.
  9. Unload the branch by selecting it and choosing Unload hive from the File menu.

  10. Revert to the previous server boot pattern or reboot the server from the OS. When you reboot the server from the OS, the boot template will automatically change to the one that was set before the server boot template was changed. the server boot pattern was set before the server boot pattern was changed.