Configuring TCP/IP
If your network doesn’t include a DHCP server, or
you want to manually assign TCP/IP configuration information, you can
do so with the netsh command. The following table shows steps you can use to configure TCP/IP.
Step | Action |
---|
1. | Type ipconfig /all and press Enter to view the current TCP/IP configuration. |
2. | Type netsh interface ipv4 show interfaces and press Enter to view the name of the network interface cards (NICs) on your system.
Note
The default name of the first NIC is Local Area Connection, but your system might have more than one NIC. You need to use the name of the NIC that you want to manipulate when using the netsh command.
|
3. | Use the following command to assign an IP address, subnet mask, and default gateway:
netsh interface ipv4 set address name=“NIC-name” static IP-address subnet-mask default-gateway
For example, to assign an IP address of 192.168.1.100, a subnet mask of
255.255.255.0, and a default gateway of 192.168.1.1 for the NIC named
Local Area Connection, use this command:
C:\>netsh interface ipv4 set address name=“local area connection” static 192.168.1.100 255.255.255.0 192.168.1.1
|
4. | Use the following command to assign the IP address of a DNS server in your network:
netsh interface ipv4 set dnsserver “NIC-name” static IP-address-of-DNS-server
For example, to assign an IP address of 192.168.1.5 for the DNS server, use this command:
C:\>netsh interface ipv4 set dnsserver “local area connection” static 192.168.1.5
|
5. | Type ipconfig /all and press Enter to view the updated TCP/IP configuration. |
Setting the Time, Date, and Time Zone
You can set the time with the time command, and you can set the date with the date
command. However, neither of these tools enables you to set the time
zone. You can launch the Control Panel Date and Time GUI with the
following command:
Figure 4 shows the Date and Time GUI that launches from this command. Click the Change Time Zone button to change the time zone. Click OK to dismiss the GUI.
Joining a Domain
After you rename the system, configure TCP/IP, and
set the correct time zone, you might want to join the computer to a
domain. You can use the netdom command to do so.
The netdom command to join a domain has the following syntax:
Netdom join %computername% /domain:domain-name
/userd:domain-account /passwordd:password
Note
The domain account must have permissions to join a
computer to a domain. Regular users in a domain have rights to join up
to ten computers to a domain.
For example, if you want to join a domain named
pearson.pub, using the administrator account that has a password of
P@ssw0rd, use the following command:
netdom join %computername% /domain:pearson.pub
/userd:administrator /passwordd:P@ssw0rd
If successful, you receive a message indicating that
the computer needs to be restarted to complete the operation. Restart
the system with the following command:
Tip
If the command is not successful, check your syntax
first. If the syntax is correct, verify that the TCP/IP configuration
is correct and that you have the correct IP address for the DNS server