Change network settings on a dedicated server
Change network settings via Rescue
Ubuntu
Debian
CentOS
-
Open the
netplanutility configuration file with thevi`` text editor:vi /etc/netplan/<netcfg>Specify
<netcfg>— the name of thenetplanutility configuration file, for example50-cloud-init.yamlor01-netcfg.yaml. -
For the required interface, change the
addressesandgateway4values to the new IP address and gateway.The configuration file is written in YAML, which is sensitive to indentation and spaces. Fill it out by following the pattern used previously.
Configuration file example
network:version: 2renderer: networkdethernets:eth0:dhcp4: noaddresses: [178.132.202.35/28]gateway4: 178.132.202.33nameservers:addresses: [188.93.16.19, 188.93.17.19]Where:
eth0— name of the network interface;addresses: [178.132.202.35/28]— server IP address with subnet mask;gateway4: 178.132.202.33— subnet gateway.
-
Press ESC.
-
Exit the
vitext editor with your changes saved::wq -
Check the configuration file for errors and apply the configuration:
netplan --debug generatenetplan apply -
In the control panel, on the top menu, click Products and select Dedicated Servers.
-
In the Servers section, open the server page → Ports tab.
-
In the internet port row, click .
-
In the VLAN field, replace the Shared value with the dedicated VLAN value. You can find the VLAN of a dedicated subnet in the control panel: on the top menu, click Products → Dedicated Servers → Network → Subnets tab.
-
Click Configure.
-
Restore the previous server boot template or restart the server from the OS. When restarting the server from the OS, the boot template will automatically change to the one that was set before changing the server boot template.
Change network settings via WinPE
Network settings can be recovered if you did the following in the network interface settings:
- clicked to obtain an address via DHCP;
- configured an incorrect IP address.
Network settings for Windows Server access are restored via 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.
-
Open
cmd. -
Output information about the network interface settings:
ipconfig /all -
Remember or copy the description field value for the required interface.
-
Open Registry Editor:
regedit -
Mount the branch containing the system and registry files to the
HKEY\_LOCAL\_MACHINEsection:6.1. Select the
HKEY_LOCAL_MACHINEsection.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 the branch name to mount to the
HKEY_LOCAL_MACHINEsection, for example,MountedSYSTEM. The branch name must not match any existing branches inHKEY_LOCAL_MACHINE.6.5. Click Open. The registry branch will appear in the section.
-
In the mounted branch, find the required network interface:
7.1. Expand the network interfaces registry key:
HKEY_LOCAL_MACHINE\\\<branch_name>\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}Specify
<branch_name>— the branch name you entered in step 6.4.The list will contain network interfaces from address 0000 to 0013.
7.2. Find the interface whose Driver Desc parameter value matches the description from step 4.
7.3. Save the NetCfgInstanceId field value.
-
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 branch name you entered in step 6.4;<net_cfg_instance_id>— the NetCfgInstanceId field value you obtained in step 7.3.
8.2. Edit the parameter values. You can view the correct values in the control panel: on the top menu, click Products → Dedicated Servers → server page → Network tab → click the required 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 one of these values:0— if you are not using DHCP;1— if you are using DHCP.
-
Unload the branch; to do this, select it and in the File menu, select Unload hive.
-
Restore the previous server boot template or restart the server from the OS. When restarting the server from the OS, the boot template will automatically change to the one that was set before changing the server boot template.