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 Rescue and Diagnostic mode.

  2. Mount the OS file system.

  3. Open the utility configuration file netplan word processor vi:

    vi /etc/netplan/01-netcfg.yaml

    or

    vi /etc/netplan/50-cloud-init.yaml
  4. For the desired interface, change the values addresses и gateway4 to a 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 — network interface name;
    • addresses: [178.132.202.35/28] — IP address of the server with subnet mask;
    • gateway4: 178.132.202.33 — subnet gateway.
  5. Press the key ESC.

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

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

    netplan --debug generate
    netplan apply
  8. В control panels go to Servers and hardwareServers.

  9. Open the server page → tab Ports.

  10. In the Internet port bar, click .

  11. In the field VLAN replace the value General to the value of the allocated VLAN. You can view the VLAN of the allocated subnet in the control panels under Servers and hardwareNetwork → tab Subnetworks.

  12. Click Configure.

  13. Bring back the old server loading 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 changes to the server load pattern.

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 any changes, access the registry from WinPE and back up the partition where the system and registry files reside, typically the following C:\Windows\System32\config\SYSTEM

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

  2. Open it up cmd.

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

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

  5. Open the program Registry Editor:

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

    • highlight a section HKEY_LOCAL_MACHINE;
    • on the menu File select Load hive;
    • in the dialog box, select the directory where the system and registry files are located, usually it is C:\Windows\system32\config\SYSTEM;
    • enter the name with which the downloaded branch will be mounted to the partition HKEY_LOCAL_MACHINE, and press Open.
  7. In the mounted branch, find the desired interface:

    • expand the registry section:
    HKEY_LOCAL_MACHINE\имя_ветки\ControlSet001\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}
    • the list will contain a list of network interfaces from the address 0000 before 0013, find the interface that has in the value of the parameter Driver Desc specified description from step 4;
    • save the field value NetCfgInstanceId of the interface we found.
  8. Change the values of the interface parameters:

    • go to the registry section:
    HKEY_LOCAL_MACHINE\имя_ветки\ControlSet001\Services\Tcpip\Parameters\Interfaces\значение_поля_NetCfgInstanceId
    • edit the parameter values: DefaultGateway; IPAddress; NameServer; SubnetMask. If you're not using DHCP — EnableDHCP in the sense of 0if you use it, it means 1. The correct values can be viewed in control panels: under Servers and hardware → server page → tab Network → click the desired subnet.
  9. Unload the branch, to do this, select it and in the menu File select Unload hive.

  10. Bring back the old server loading 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 changes to the server load pattern.