Useful network commands

All documents from the original Software Support Library (SSL)

Moderators: Leon van Heerden, Luanda_Junzi, Belinda Frick, Lee Hendricks

Useful network commands

Postby Belinda Frick » Thu Nov 18, 2010 10:34 am

OVERVIEW

All these commands are run from the DOS prompt.

To get to the DOS Prompt,
Click Start > Run
In the dialogue box type in cmd and hit enter

a window will appear with a black background and white text.


Commands


ping

Use the ping command to check if you can connect to another pc on the network. This is useful when
trying to see whether the client pc can connect to AMETHYST.

ping (host name/ip address) i.e ping amethyst

result if succesful:

Pinging amethyst.datatex.co.za [192.168.x.x] with 32 bytes of data:

Reply from 192.168.15.6: bytes=32 time<1ms TTL=64
Reply from 192.168.15.6: bytes=32 time<1ms TTL=64
Reply from 192.168.15.6: bytes=32 time<1ms TTL=64
Reply from 192.168.15.6: bytes=32 time<1ms TTL=64

If failed

Pinging 192.168.x.x with 32 bytes of data:

Destination host unreachable.
Destination host unreachable.
Destination host unreachable.
Destination host unreachable.


netstat

This command shows the local ports in use and connections to other machines.

Use this command when you want to see the different connections currently in use.
Useful command when trying to figure what ports are in use.
i.e netstat -na (no DNS lookups and all connections)

Result:
Active Connections

Proto Local Address Foreign Address State
TCP 0.0.0.0:111 0.0.0.0:0 LISTENING
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:872 0.0.0.0:0 LISTENING
TCP 0.0.0.0:874 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1039 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1047 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1048 0.0.0.0:0 LISTENING
TCP 0.0.0.0:2049 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3050 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING
TCP 0.0.0.0:5800 0.0.0.0:0 LISTENING
TCP 0.0.0.0:5900 0.0.0.0:0 LISTENING
TCP 0.0.0.0:27004 0.0.0.0:0 LISTENING
TCP 0.0.0.0:27015 0.0.0.0:0 LISTENING
TCP 0.0.0.0:27997 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1040 0.0.0.0:0 LISTENING
TCP 192.168.15.77:139 0.0.0.0:0 LISTENING
TCP 192.168.15.77:1397 192.168.15.10:139 ESTABLISHED
TCP 192.168.15.77:1433 192.168.15.7:445 ESTABLISHED
TCP 192.168.15.77:1642 192.168.15.10:3050 ESTABLISHED
TCP 192.168.15.77:2451 192.168.15.9:139 ESTABLISHED
TCP 192.168.15.77:3373 192.168.15.9:1025 ESTABLISHED
TCP 192.168.15.77:4200 192.168.15.10:3050 ESTABLISHED
TCP 192.168.15.77:4752 192.168.15.9:1295 ESTABLISHED
TCP 192.168.15.77:4876 192.168.15.10:10080 CLOSE_WAIT
TCP 192.168.15.77:4877 192.168.15.10:10080 CLOSE_WAIT
UDP 0.0.0.0:111 *:*
UDP 0.0.0.0:445 *:*
UDP 0.0.0.0:500 *:*
UDP 0.0.0.0:873 *:*
UDP 0.0.0.0:875 *:*
UDP 0.0.0.0:897 *:*
UDP 0.0.0.0:926 *:*
UDP 0.0.0.0:1028 *:*
UDP 0.0.0.0:1035 *:*
UDP 0.0.0.0:1039 *:*
UDP 0.0.0.0:1047 *:*
UDP 0.0.0.0:1048 *:*
UDP 0.0.0.0:1089 *:*
UDP 0.0.0.0:1093 *:*
UDP 0.0.0.0:1225 *:*
UDP 0.0.0.0:1226 *:*
UDP 0.0.0.0:1227 *:*
UDP 0.0.0.0:2049 *:*
UDP 0.0.0.0:2182 *:*
UDP 0.0.0.0:2190 *:*
UDP 0.0.0.0:3374 *:*
UDP 0.0.0.0:4016 *:*
UDP 0.0.0.0:4500 *:*
UDP 0.0.0.0:25001 *:*
UDP 0.0.0.0:25003 *:*
UDP 0.0.0.0:27002 *:*
UDP 0.0.0.0:27016 *:*
UDP 127.0.0.1:123 *:*
UDP 127.0.0.1:1551 *:*
UDP 127.0.0.1:1900 *:*
UDP 192.168.15.77:123 *:*
UDP 192.168.15.77:137 *:*
UDP 192.168.15.77:138 *:*
UDP 192.168.15.77:1900 *:*

You can also run "netstat -nba" to see which process has a port open.

Proto Local Address Foreign Address State PID
TCP 0.0.0.0:3050 0.0.0.0:0 LISTENING 3000
[fbserver.exe]

TCP 192.168.15.96:139 0.0.0.0:0 LISTENING 4
[System]

UDP 0.0.0.0:2529 *:* 200
[Onyx_Sweeper.exe]

UDP 0.0.0.0:27004 *:* 200
[Onyx_Sweeper.exe]




arp -a

Displays and modifies the IP-to-Physical address translation tables used by
address resolution protocol (ARP). Can be used in troubleshooting if there
is an IP conflict with AMETHYST.
If there is, the physical address would be different for the same IP address

Interface: 192.168.15.77 --- 0x2
Internet Address Physical Address Type
192.168.15.6 00-11-11-b2-3e-7f dynamic
192.168.15.7 00-11-11-7f-bc-fc dynamic
192.168.15.9 00-13-20-8e-0f-52 dynamic
192.168.15.10 00-03-47-31-d1-24 dynamic


All the above commands are available with the /? switch should you wish to learn
more about them and their uses.
Belinda Frick
 
Posts: 3808
Joined: Fri Nov 12, 2010 4:25 pm

Return to Support Archive's (Amethyst)

Who is online

Users browsing this forum: No registered users and 1 guest