DHCP. Obtaining an IP address and network settings automatically.

All our servers are configured to obtain network settings automatically via the DHCP protocol. In this mode, the server automatically receives its assigned IP address, subnet mask, gateway address and DNS servers. Using DHCP lets us automate the setup of new servers and migrate VDS servers between host nodes without having to change network settings manually, and also lets you use various live distributions and service discs (such as Acronis) that pick up the network on the fly.

Despite the convenience and advantages of obtaining network settings via DHCP, there are situations where you need to configure the network manually. For example, static (static IP) network settings are required to set up a DNS server, a routing service, a mail server and some other server services. In addition, the network must be configured manually if you want to set up two IP addresses for your server.

Manual network configuration. Setting a static IP.

Open the console: "Start" -> "Run" -> "OK"

Run the following commands in the console, depending on your OS. Note: in all the commands below, replace %IP% with your server's IP address!

On Windows Server 2003:

netsh interface ip add dns "Local Area Connection" 213.133.99.99
netsh interface ip add dns "Local Area Connection" 213.133.98.98
netsh interface ip add dns "Local Area Connection" 8.8.8.8
netsh interface ip set address "Local Area Connection" static %IP% 255.255.255.240 %IP% 1

On Windows Server 2008:

netsh interface ip add dnsservers "Подключение по локальной сети" 213.133.99.99
netsh interface ip add dnsservers "Подключение по локальной сети" 213.133.98.98
netsh interface ip add dnsservers "Подключение по локальной сети" 8.8.8.8
netsh interface ip set address "Подключение по локальной сети" static %IP% 255.255.255.240 %IP% 1

Note: after you run the last command, your Remote Desktop session will be dropped (disconnected), and you will need to reconnect.

If all commands completed successfully (no error messages), congratulations: your server is now configured to use a static IP address with the network settings you specified.

If something went wrong and the server is not reachable over the network, use the VNC console to fix the mistakes.

To restore automatic DHCP settings, use the following commands:

for Windows Server 2003:

netsh interface ip set dns "Local area Connection" dhcp
netsh interface ip set address "Local area Connection" dhcp

for Windows Server 2008:

netsh interface ip set dnsserver "Подключение по локальной сети" dhcp
netsh interface ip set address "Подключение по локальной сети" dhcp

Adding a second IP address

For the second IP address assigned to you to work, it must be added to the network interface settings. This can only be done once the network has already been configured manually!

To add a second IP address, run one of the following commands in the console (replace %IP2% with the additional IP assigned to you):

netsh interface ip add address "Local Area Connection" %IP2% 255.255.255.240 (for Windows Server 2003)
netsh interface ip add address "Подключение по локальной сети" %IP2% 255.255.255.240 (for Windows Server 2008)

  • 205 Users Found This Useful
Was this answer helpful?
Related Articles
How do I make programs start automatically on the server?
Let's look at how a server starts up, so that what follows is easier to understand: 1) you turn the server's "power" on or restart it using the "reset" function2) the server powers on and the OS boots!--> at this point the server does not...
No more than 2 people can connect to the server via Remote Desktop at the same time
To allow more than two people to work on the server at the same time, you need to install a terminal server on it.
Questions about antivirus protection and firewall on the server
Q: What antivirus protection is installed on the server? A: An antivirus is not part of the operating system and, accordingly, is not included in its distribution. Q: Do I need to install additional software (antivirus, firewall, etc.) to...
How do I enable sound when working via Remote Desktop?
If you want sound to work when connecting via Remote Desktop (i.e. sound played on the server is transferred to your computer), first of all you need to enable the corresponding option in the RDP client settings. To do this, after launching the...
What other ways are there to copy files to my server?
Besides copying files via the clipboard, you can use other file transfer methods. For example, Radmin or TeamViewer. If you want to use these tools, you need to install the corresponding software on the server. Additional information, instructions...