Home arrow Support arrow FAQ Frequent Questions arrow Windows Commands for Troubleshooting TCP/IP
Windows Commands for Troubleshooting TCP/IP
Documents and FAQs
Windows Troubleshooting Commands for Troubleshooting TCP/IP - (for Windows 95, 98, ME, NT, 2000, XP).

Requirements:
Access to a console/ DOS window on a Windows 98, ME, NT, 2000, XP operating system with a working Ethernet interface.

Estimated Time:
10 minutes

Summary:
This is a list of common Windows networking commands, their options and sample output. The commands and their common uses are in the table below.

Command Common use

IPCONFIGCheck IP address and DNS configuration, Renew DHCP configuration
PINGCheck if a remote Ethernet device is available or working
ARPVerify that the ARP table is correct, especially if a device is changed but uses the same IP address
ROUTEVerify data routes are correct, check precedence of multiple entries, see MAC hardware addresses of workstation ethernet interfaces
TRACERTSee route data uses to reach remote destination, identify possible network congestion
NETSTATSee which ports are being used on the workstation and the status of those connections
PPTPSRV & PPTPCLNTTest Microsoft VPN connectivity
TELNETConnect to remote computer, test port address translation by mapping different ports to different servers, test if a remote web server is available, test if WAN connection is ok
FTPTest download speed, test remote connection
IPCONFIG

USAGE: ipconfig [/? | /all | /release [adapter] | /renew [adapter]
| /flushdns | /registerdns
| /showclassid adapter
| /setclassid adapter [classidtoset] ]

adapter Full name or pattern with '*' and '?' to 'match', * matches any character, ? matches one character. Options
/? Display this help message.
/all Display full configuration information.
/release Release the IP address for the specified adapter.
/renew Renew the IP address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.

The default is to display only the IP address, subnet mask and default gateway for each adapter bound to TCP/IP.

For Release and Renew, if no adapter name is specified, then the IP address leases for all adapters bound to TCP/IP will be released or renewed.

For SetClassID, if no class id is specified, then the classid is removed.

Examples:
> ipconfig ... Show information.
> ipconfig /all ... Show detailed information
> ipconfig /renew ... renew all adapaters
> ipconfig /renew EL* ... renew adapters named EL....
> ipconfig /release *ELINK?21* ... release all matching adapters,
eg. ELINK-21, myELELINKi21adapter.

IPCONFIG EXAMPLE

C:>ipconfig

Windows 2000 IP Configuration

Ethernet adapter Local Area Connection 2:

Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.0.0.21
Subnet Mask . . . . . . . . . . . : 255.0.0.0
Default Gateway . . . . . . . . . :

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : lightning.ch
IP Address. . . . . . . . . . . . : 192.168.0.8
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1

C:>ipconfig /all

Windows 2000 IP Configuration

Host Name . . . . . . . . . . . . : Win2K-wrk
Primary DNS Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Broadcast
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : lightning.ch

Ethernet adapter Local Area Connection 2:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : INTEL PCI Ethernet Adapter #2
Physical Address. . . . . . . . . : 00-c0-f0-dd-ea-9a
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 10.0.0.21
Subnet Mask . . . . . . . . . . . : 255.0.0.0
Default Gateway . . . . . . . . . : 10.0.0.1
DNS Servers . . . . . . . . . . . : 10.0.0.1

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : lightning.ch
Description . . . . . . . . . . . : INTEL PCI Ethernet Adapter
Physical Address. . . . . . . . . : 00-c0-f0-b7-02-b7
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.0.8
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 212.147.10.10
212.147.0.1
Lease Obtained. . . . . . . . . . : Thursday, 26. July 2001 03:09:35
Lease Expires . . . . . . . . . . : Thursday, 26. July 2001 03:19:35

PING

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] destination-list

Options:
-t Ping the specified host until stopped.
To see statistics and continue - type Control-Break;
To stop - type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count Record route for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list
-w timeout Timeout in milliseconds to wait for each reply.

PING EXAMPLE C:>ping pegaze

Pinging pegaze.lightning.ch [193.247.134.2] with 32 bytes of data:

Reply from 193.247.134.2: bytes=32 time=20ms TTL=255
Reply from 193.247.134.2: bytes=32 time<10ms TTL=255
Reply from 193.247.134.2: bytes=32 time<10ms TTL=255
Reply from 193.247.134.2: bytes=32 time=10ms TTL=255

Ping statistics for 193.247.134.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 20ms, Average = 7ms

ARP

Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol (ARP).

ARP -s inet_addr eth_addr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]

-a Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed.
-g Same as -a.
inet_addr Specifies an internet address.
-N if_addr Displays the ARP entries for the network interface specified by if_addr.
-d Deletes the host specified by inet_addr. inet_addr may be wildcarded with * to delete all hosts.
-s Adds the host and associates the Internet address inet_addr with the Physical address eth_addr. The Physical address is given as 6 hexadecimal bytes separated by hyphens. The entry is permanent.
eth_addr Specifies a physical address.
if_addr If present, this specifies the Internet address of the interface whose address translation table should be modified. If not present, the first applicable interface will be used.
Example:
> arp -s 157.55.85.212 00-aa-00-62-c6-09 .... Adds a static entry.
> arp -a .... Displays the arp table.

ARP EXAMPLE C:>arp -a

Interface: 192.168.0.8 on Interface 0x3
Internet Address Physical Address Type
192.168.0.1 00-c0-f0-ab-cd-57 dynamic
192.168.0.2 00-c0-f0-ef-12-34 dynamic
192.168.0.3 00-c0-f0-aa-bb-cc dynamic
192.168.0.4 00-c0-f0-d1-e2-f3 dynamic

ROUTE

Manipulates network routing tables.

ROUTE [-f] [-p] [command [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]

-f Clears the routing tables of all gateway entries. If this is used in conjunction with one of the commands, the tables are cleared prior to running the command.
-p When used with the ADD command, makes a route persistent across boots of the system. By default, routes are not preserved when the system is restarted. Ignored for all other commands, which always affect the appropriate persistent routes. This option is not supported in Windows 95. command One of these:
PRINT Prints a route
ADD Adds a route
DELETE Deletes a route
CHANGE Modifies an existing route
destination Specifies the host.
MASK Specifies that the next parameter is the 'netmask' value.
netmask Specifies a subnet mask value for this route entry.
If not specified, it defaults to 255.255.255.255.
gateway Specifies gateway.
interface the interface number for the specified route.
METRIC specifies the metric, ie. cost for the destination.

All symbolic names used for destination are looked up in the network database file NETWORKS. The symbolic names for gateway are looked up in the host name database file HOSTS.

If the command is PRINT or DELETE. Destination or gateway can be a wildcard, (wildcard is specified as a star '*'), or the gateway argument may be omitted.

If Dest contains a * or ?, it is treated as a shell pattern, and only matching destination routes are printed. The '*' matches any string, and '?' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.
Diagnostic Notes:
Invalid MASK generates an error, that is when (DEST & MASK) != DEST. Example> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1 The route addition failed: The specified mask parameter is invalid. (Destination & Mask) != Destination.

Examples:

> route PRINT > route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2 destination^ ^mask ^gateway metric^ ^ Interface^
If IF is not given, it tries to find the best interface for a given gateway.
> route PRINT
> route PRINT 157* .... Only prints those matching 157*
> route DELETE 157.0.0.0
> route PRINT

ROUTE EXAMPLE
C:>route print

===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ... 00-c0-f0-dd-ea-9a...... INTEL Ethernet Adapter
0x3 ... 00-c0-f0-b7-02-b7...... INTEL Ethernet Adapter
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 255.255.255.255 10.0.0.21 10.0.0.21 1
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.8 1
10.0.0.0 255.0.0.0 10.0.0.21 10.0.0.21 1
10.0.0.21 255.255.255.255 127.0.0.1 127.0.0.1 1
10.255.255.255 255.255.255.255 10.0.0.21 10.0.0.21 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.0.0 255.255.255.0 192.168.0.8 192.168.0.8 1
192.168.0.8 255.255.255.255 127.0.0.1 127.0.0.1 1
255.255.255.255 255.255.255.255 10.0.0.21 10.0.0.21 1
Default Gateway: 10.0.0.21
===========================================================================
Persistent Routes:
None

TRACERT

Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply.

TRACERT EXAMPLE
C:>tracert www.nytimes.com

Tracing route to www.nytimes.com [208.48.26.200]
over a maximum of 30 hops:

1 <10 ms <10 ms <10 ms 10.0.0.1
2 30 ms 40 ms 40 ms isp.ch [190.1.2.6]
3 40 ms 30 ms 40 ms ethernet.carrier1.net [122.4.14.37]
4 40 ms 41 ms 40 ms serial.carrier1.net [122.4.13.161]
5 40 ms 30 ms 30 ms pos.carrier1.net [122.4.22.178]
6 50 ms 50 ms 50 ms pos.carrier1.net [122.4.22.189]
7 140 ms 140 ms 150 ms pos.nyc.carrier1.net [122.4.11.5]
8 140 ms 150 ms 140 ms gigabitethernet.nyc.carrier1.net [122.4.13.218]
9 140 ms 150 ms 140 ms ibr.jrcy.exodus.net [209.1.169.193]
10 130 ms 141 ms 140 ms bbr.jrcy.exodus.net [216.32.223.98]
11 130 ms 140 ms 140 ms bbr.nycm.exodus.net [206.79.9.178]
12 130 ms 141 ms 140 ms 64.15.224.20
13 140 ms 141 ms 130 ms 64.15.224.21
14 140 ms 130 ms 140 ms 208.48.26.200

NETSTAT

Displays protocol statistics and current TCP/IP network connections.

NETSTAT [-a] [-e] [-n] [-s] [-p proto] [-r] [interval]

-a Displays all connections and listening ports.
-e Displays Ethernet statistics. This may be combined with the -s option.
-n Displays addresses and port numbers in numerical form.
-p proto Shows connections for the protocol specified by proto; proto may be TCP or UDP. If used with the -s option to display per-protocol statistics, proto may be TCP, UDP, or IP.
-r Displays the routing table.
-s Displays per-protocol statistics. By default, statistics are shown for TCP, UDP and IP; the -p option may be used to specify a subset of the default.
interval Redisplays selected statistics, pausing interval seconds between each display. Press CTRL+C to stop redisplaying statistics. If omitted, netstat will print the current configuration information once.

NETSTAT EXAMPLES
C:>netstat
Active Connections

Proto Local Address Foreign Address State
TCP Win2K-wrk:1057 lightning.ch:telnet ESTABLISHED
TCP Win2K-wrk:1058 lightning.ch:ftp ESTABLISHED
TCP Win2K-wrk:1061 207.68.171.254:http ESTABLISHED
TCP Win2K-wrk:1077 lightning.ch:netbios-ssn TIME_WAIT
TCP Win2K-wrk:2407 corp.bank.org:https ESTABLISHED
TCP Win2K-wrk:2474 doubleclick.net:http LAST_ACK
TCP Win2K-wrk:2547 pop3.lightning.ch:smtp SYN_SENT
TCP Win2K-wrk:2663 ssh.server.ch:22 ESTABLISHED

C:>netstat -n
Active Connections

Proto Local Address Foreign Address State
TCP 192.168.0.8:1057 193.247.134.2:23 ESTABLISHED
TCP 192.168.0.8:1058 193.247.134.2:21 ESTABLISHED
TCP 192.168.0.8:1061 207.68.171.254:80 ESTABLISHED
TCP 192.168.0.8:1077 193.247.134.2:139 TIME_WAIT
TCP 10.0.0.22:2407 111.17.44.82:443 ESTABLISHED
TCP 10.0.0.22:2474 208.184.29.90:80 LAST_ACK
TCP 10.0.0.22:2547 192.168.0.2:25 SYN_SENT
TCP 10.0.0.22:2663 111.17.44.82:22 ESTABLISHED

PPTPSRV & PPTPCLNT

For Windows 2000 only. These support tools are located on your Windows 2000 installation CD at supportTOOLS>setup.exe. You must run this program to unpack these tools. They will test connectivity for PPTP connections.
PPTPSRV.exe
PPTPCLNT.exe

C:>pptpsrv

Now you must run pptpclnt.exe on remote machine

Waiting for inbound connection on TCP port 1723...
Inbound connection from client has completed successfully!

Data received from client:
---> testing VPN

Sending the message 'Reply from server' to the client

=====================================================
Connectivity test to TCP Port 1723 was successful!!!
Closing down socket...
=====================================================

Created socket for GRE protocol test

Listening on PROTOCOL 47 for incoming GRE packets...

Total GRE packets received = 1
Total GRE packets received = 2
Total GRE packets received = 3
Total GRE packets received = 4
Total GRE packets received = 5

======================================
GRE protocol test was successful!
======================================

Closing socket

Goodbye!

PPTPCLNT SAMPLE
C:>pptpclnt

Syntax: pptpclnt [servername|address]

Programming by Gerald Lesan and Romano Jerez.
Special thanks to Karl Westerholm and Tod Edwards for helping with testing.

C:>pptpclnt 127.0.0.1

Initializing WinSock...
Obtaining host information...
Successfully resolved server's host information

======================================
Enter data to send to server (between 1 and 255 chrs.), then hit enter:
-->testing VPN

Successfully connected to server using TCP port 1723 (PPTP)
Sending data to server

Waiting for a reply to the data which was just sent...
Received a reply. Reply contains the following text:
---> Hello, there! This is a reply from the server.

=================================
Connectivity test to TCP Port 1723 was successful!!!
Closing down socket...
=================================

Creating a socket to test GRE protocol traffic...

Total GRE packets sent = 1
Total GRE packets sent = 2
Total GRE packets sent = 3
Total GRE packets sent = 4
Total GRE packets sent = 5

=====================================
Check server to see if the GRE packets were received successfully
=====================================

Closing down socket

Goodbye!

TELNET

telnet [host [port]]

host specifies the hostname or IP address of the remote
computer to connect to.

port Specifies the port number or
service name.

TELNET SAMPLE
C:>telnet 10.0.0.1
Connecting to 10.0.0.1…

Linux 2.4.5 (MultiCom) (ttyp0)

MultiCom login: multicom
Password:
/:

or

C:>telnet www.lightning.ch 80
Connecting to www.lightning.ch…

FTP

Commands may be abbreviated. Commands are:
! Escape to the shell
? Print local help information
append Append to a file
ascii Set ascii transfer type
bell Beep when command completed
binary Set binary transfer type
bye Terminate ftp session and exit
cd Change remote working directory
close Terminate ftp session
delete Delete remote file
debug Toggle debugging mode
dir List contents of remote directory
disconnect Terminate ftp session
get Receive file
glob Toggle metacharacter expansion of local file names
hash Toggle printing `#' for each buffer transferred
help Print local help information
lcd Change local working directory
literal Send arbitrary ftp command
ls List contents of remote directory
mdelete Delete multiple files
mdir List contents of multiple remote directories
mget Get multiple files
mkdir Make directory on the remote machine
mls List contents of multiple remote directories
mput Send multiple files
open Connect to remote tftp
prompt Force interactive prompting on multiple commands
put Send one file
pwd Print working directory on remote machine
quit Terminate ftp session and exit
quote Send arbitrary ftp command
recv Receive file
remotehelp Get help from remote server
rename Rename file
rmdir Remove directory on the remote machine
send Send one file
status Show current status
trace Toggle packet tracing
type Set file transfer type
user Send new user information
verbose Toggle verbose mode

FTP SAMPLE LOCAL NETWORK
File transfer over the internet

D:>ftp ftp.zdnet.com
Connecté à ftp.zdnet.com.
220 abv-sfo1-zd-ftp3 FTP server (Version wu-2.6.1(2) Wed Jun 13 23:04:31 PDT 200
1) ready.
Utilisateur (ftp.zdnet.com:(none)) : anonymous
331 Guest login ok, send your complete e-mail address as password.
Mot de passe :
230 Guest login ok, access restrictions apply.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
CrystalPortAppCapture5.exe
rdist.txt
welcome.msg
226 Transfer complete.
ftp> get rdist.txt
200 PORT command successful.
150 Opening ASCII mode data connection for rdist.txt (4653683 bytes).
226 Transfer complete.
ftp : 4742332 octets reçus dans 208.81Secondes 22.71Ko/sec.
ftp> binary
200 Type set to I.
ftp> get CrystalPortAppCapture5.exe
200 PORT command successful.
150 Opening BINARY mode data connection for CrystalPortAppCapture5.exe (2574848 bytes).
226 Transfer complete.
ftp : 2574848 octets reçus dans 134.41Secondes 19.16Ko/sec.
226 Transfer complete.

Faster transfers when FTP'ing to a server on the same network
ftp> binary
---> TYPE I
200 Type set to I.
ftp> get test.zip
---> PORT 192,168,0,25,4,81
200 PORT command successful.
---> RETR test.zip
150 Opening BINARY mode data connection for test.zip (172431377 bytes).
226 Transfer complete.
ftp: 172431377 bytes received in 103.60Seconds 1664.41Kbytes/sec.

RESOURCES

For more detailed information check the following Microsoft Technical Articles.
These articles are available online at http://search.support.microsoft.com/kb/c.asp.

Q102908 - How to Troubleshoot TCP/IP Connectivity with Windows NT
Q162326 - Using TRACERT to Troubleshoot TCP/IP Problems in Windows NT
Q137984 - TCP Connection States and Netstat Output
Q163391 - Troubleshooting Problems Communicating on the Internet
Q117662 - IPCONFIG Diagnostic Utility: Parameters and Usage
Q120599 - Detection of Duplicate IP Addresses by Microsoft TCP/IP
Q246926 - Folder Listing of the Support Tools Included in Windows 2000
Q279466 - How to Request a Web Page Through a TELNET Client


 
Next >