Skip to main content
Change network settings on the server
Last update:

Change network settings on the server

Change network settings via Rescue

  1. Boot the server in Recovery and Diagnostic Rescue 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 YAML, a tab- and space-sensitive language. Fill it out similar to how it was filled out previously.

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

    Here:

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

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

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

    netplan --debug generate
    netplan apply
  8. In Control Panel, go to Servers and HardwareServers.

  9. Open the server page → Ports tab.

  10. In the Internet port bar, click .

  11. In the VLAN field, replace the value General with the value of the allocated VLAN. You can view the VLAN of a dedicated subnet in Control Panel under Servers and HardwareNetworkSubnets tab.

  12. Click Configure.

  13. Return the previous server boot template 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 change server boot template.

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.

Restore network settings for Windows Server access is done through the registry. Before making changes, access 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. Output information about the settings of the network interfaces:

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

  5. Open the Registry Editor program:

    regedit
  6. Mount the branch with the system and registry files to the HKEY_LOCAL_MACHINE partition:

    • highlight the HKEY_LOCAL_MACHINE section;
    • from the File menu, select Load hive;
    • in the dialog box, select the directory where the system and registry files are located, usually C:Windows\system32\config\SYSTEM;
    • 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:

    • expand the registry section:
    HKEY_LOCAL_MACHINE\branch name\ControlSet001\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}
    • The list will contain a list of network interfaces from 0000 to 0013, find the interface that has the description from step 4 in the Driver Desc parameter;
    • save the value of the NetCfgInstanceId field of the found interface.
  8. Change the values of the interface parameters:

    • go to the registry section:
    HKEY_LOCAL_MACHINE\branch_name\ControlSet001\Services\Tcpip\Parameters\Interfaces\NetCfgInstanceId field value.
    • edit the values of the parameters: DefaultGateway; IPAddress; NameServer; SubnetMask. If you are not using DHCP — EnableDHCP at 0, if you are using it — at 1. The correct values can be viewed in Control Panel: under Servers and Hardware → Server page → Network tab → click on the desired subnet.
  9. Unload the hive by selecting it and choosing Unload hive from the File menu.

  10. Return the previous server boot template 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 change server boot template.