2/22/2012 -- The next release of the A+ exams from CompTIA includes objectives on command-line utilities beneath the operating system domain. Some of the tools are Windows-specific, while those related to networking work on any operating system running TCP/IP. There is overlap between those and the Network+ certification objectives. Since the topic appears on both exams -- as well as a few others from other vendors -- the following is a look at the network-related command-line tools you are required to know for the A+ certification.
The networking command-line tools you are expected to know for this exam are: ping, tracert, netstat, ipconfig, net, nslookup and nbtstat.
PING Command
The PING command is one of the most useful commands in the TCP/IP protocol. It sends a series of packets to another system, which in turn sends back a response. This utility can be extremely useful for troubleshooting problems with remote hosts. Pings are also called ICMP echo requests/replies, as they use the ICMP protocol.
The PING command indicates whether the host can be reached and how long it took for the host to send a return packet. Across wide area network links, the time value will be much larger than across healthy LAN links.
The syntax for PING is ping hostname or ping IP address. There are several options for the PING command, and you can see them all by typing ping /? at the command prompt. The following table lists some of the more useful ones:
Option
|
Function
|
-t
|
Persistent ping. Will ping the remote host until stopped by the client (by using Ctrl+C)
|
-n count
|
Specifies the number of echo requests to send
|
-l size
|
Specifies the packet size to send
|
TRACERT Command
Tracert (trace route) is a command-line utility that enables you to verify the route to a remote host. Execute the command TRACERT hostname, where hostname is the computer name or IP address of the computer whose route you want to trace. Tracert returns the different IP addresses the packet was routed through to reach the final destination. The results also include the number of hops needed to reach the destination. If you execute the TRACERT command without any options, you see a help file that describes all the TRACERT switches.
This utility determines the intermediary steps involved in communicating with another IP host. It provides a road map of all the routing an IP packet takes to get from host A to host B.
Timing information from TRACERT can be useful for detecting a malfunctioning or overloaded router.
NETSTAT Command
The netstat utility is used to check out the inbound and outbound TCP/IP connections on your machine. It can also be used to view packet statistics, such as how many packets have been sent and received and the number of errors.
There are several useful command-line options for NETSTAT, as shown in the following table:
Option
|
Function
|
-a
|
Displays all connections and listening ports.
|
-b
|
Displays the executable involved in creating each connection or listening port. In some cases, well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case, the executable name is in brackets, [ ], at the bottom; at the top is the component it called; and so forth until TCP/IP was reached. Note that this option can be time consuming and will fail unless you have sufficient permissions.
|
-e
|
Displays Ethernet statistics. This may be combined with the -s option.
|
-f
|
Displays fully qualified domain names (FQDN) for foreign addresses
|
-n
|
Displays addresses and port numbers in numerical form
|
-o
|
Displays the owning process ID associated with each connection
|
-p proto
|
Shows connections for the protocol specified by proto; proto may be any of the following: TCP, UDP, TCPv6, or UDPv6. If used with the -s option to display per-protocol statistics, proto may be any of IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.
|
-r
|
Displays the routing table
|
-s
|
Displays per-protocol statistics. By default, statistics are shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6; the -p option may be used to specify a subset of the default.
|
IPCONFIG Command
With Windows-based operating systems, you can determine the network settings on the client's network interface cards, as well as any that a DHCP server has leased to your computer, by typing the following at a command prompt: ipconfig /all.
IPCONFIG /ALL also gives you full details on the duration of your current lease. You can verify whether a DHCP client has connectivity to a DHCP server by releasing the client's IP address and then attempting to lease an IP address. You can conduct this test by typing the following sequence of commands from the DHCP client at a command prompt:
ipconfig /renew ipconfig /release
Ipconfig is one of the first tools to use when experiencing problems accessing resources, as it will show you whether an address has been issued to the machine. If the address displayed falls within the 169.254.x.x category, this means the client was unable to reach the DHCP server and has defaulted to Automatic Private IP Addressing (APIPA), which will prevent the card from communicating outside its subnet, if not altogether. The following table lists useful switches for IPCONFIG:
Switch
|
Purpose
|
/ALL
|
Shows full configuration information
|
/RELEASE
|
Releases the IP address, if you are getting addresses from a Dynamic Host Configuration Protocol (DHCP) server
|
/RENEW
|
Obtains a new IP address from a DHCP server
|
/FLUSHDNS
|
Flushes the domain name server (DNS) name resolver cache
|
NET Command
Depending on the version of Windows you are using, NET can be one of the most powerful commands at your disposal. While all Windows versions include a NET command, the capabilities of it differ based on whether it is server or workstation based and the version of the operating system.
While always command line based, this tool allows you to do almost anything you want with the operating system.
The following table shows common NET switches:
Switch
|
Purpose
|
NET ACCOUNTS
|
Set account options (password age, length, etc.)
|
NET COMPUTER
|
Add and delete computer accounts
|
NET CONFIG
|
See network-related configuration
|
NET CONTINUE, NET PAUSE, NET START, NET STATISTICS, and NET STOP
|
Control services
|
NET FILE
|
Close open files
|
NET GROUP and NET LOCALGROUP
|
Create, delete, and change groups
|
NET HELP
|
See general help
|
NET HELPMSG
|
See specific message help
|
NET NAME
|
See the name of the current machine and user
|
NET PRINT
|
Interact with print queues and print jobs
|
NET SEND
|
Send a message to user(s)
|
NET SESSION
|
See session statistics
|
NET SHARE
|
Create a share
|
NET TIME
|
Set the time to that of another computer
|
NET USE
|
Connect to a share
|
NET USER
|
Add, delete, and see information about a user
|
NET VIEW
|
See available resources
|
These commands are invaluable troubleshooting aids when you cannot get the graphical interface to display properly. You can also use them when interacting with hidden ($) and administrative shares that do not appear within the graphical interface.
The NET command used with the SHARE parameter enables you to create shares from the command prompt, using this syntax:
NET SHARE <share_name>=<drive_letter>:<path>
To share the C:\EVAN directory as SALES, you would use the following command:
NET SHARE SALES=C:\EVAN
You can use other parameters with NET SHARE to set other options. The following table summarizes the most commonly used parameters:
Parameter
|
Purpose
|
/DELETE
|
Stop sharing a folder
|
/REMARK
|
Add a comment for browsers
|
/UNLIMITED
|
Set the user limit to Maximum Allowed
|
/USERS
|
Set a specific user limit
|
The NET /? command is basically a catch-all help request. It will instruct you to use the NET command you are interested in for more information.
NSLOOKUP Command
Nslookup is a command-line utility that enables you to verify entries on a DNS server. You can use nslookup in two modes: interactive and noninteractive. In interactive mode, you start a session with the DNS server, in which you can make several requests. In noninteractive mode, you specify a command that makes a single query of the DNS server. If you want to make another query, you must type another noninteractive command.
One of the key issues regarding the use of TCP/IP is the ability to resolve a hostname to an IP address -- an action usually performed by a DNS server.
NBTSTAT Command
Nbtstat is a command line utility that shows NetBIOS over TCP/IP information. While not used as often as other entries in this category, it can be useful when trying to diagnose a problem with NetBIOS name resolution. The /? parameter can be used to see the available switches.
|