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