Networking Commands
Networking Commands
There are a lot of IP commands with short descriptions listed here but you should only need the ones
mentioned here at the top of the page to diagnose and configure your network.
C:>ping
C:>ipconfig
C:>ipconfig /all
C:>ipconfig /release
C:>ipconfig /renew
C:\>nbtstat –a
Remember when typing from the command prompt you can only type one command per line, and press Enter
after each one to execute it.
C:\>arp –a: is short for address resolution protocol, It will show the IP address of your computer along with the IP
address and MAC address of your router.
C:\>hostname: This is the simplest of all TCP/IP commands. It simply displays the name of your computer.
C:\>ipconfig: The ipconfig command displays information about the host (the computer your sitting at)computer
TCP/IP configuration.
C:\>ipconfig /all: This command displays detailed configuration information about your TCP/IP connection
including Router, Gateway, DNS, DHCP, and type of Ethernet adapter in your system.
C:\>Ipconfig /renew: Using this command will renew all your IP addresses that you are currently (leasing) borrowing
from the DHCP server. This command is a quick problem solver if you are having connection issues, but does not
work if you have been configured with a static IP address.
C:\>Ipconifg /release: This command allows you to drop the IP lease from the DHCP server.
C:\>ipconfig /flushdns: This command is only needed if you’re having trouble with your networks DNS configuration.
The best time to use this command is after network configuration frustration sets in, and you really need the
computer to reply with flushed.
C:\>nbtstat –a: This command helps solve problems with NetBIOS name resolution.
(Nbt stands for NetBIOS over TCP/IP)
Definitions
C:\netdiag: Netdiag is a network testing utility that performs a variety of network diagnostic tests, allowing you to
pinpoint problems in your network. Netdiag isn’t installed by default, but can be installed from the Windows XP CD
after saying no to the install. Navigate to the CD ROM drive letter and open the support\tools folder on the XP CD
and click the setup.exe icon in the support\tools folder.
C:\>netstat: Netstat displays a variety of statistics about a computers active TCP/IP connections. This tool is
most useful when you’re having trouble with TCP/IP applications such as HTTP, and FTP.
C:\>nslookup: Nslookup is used for diagnosing DNS problems. If you can access a resource by specifying an
IP address but not it’s DNS you have a DNS problem.
C:\>pathping: Pathping is unique to Window’s, and is basically a combination of the Ping and Tracert commands.
Pathping traces the route to the destination address then launches a 25 second test of each router along the way,
gathering statistics on the rate of data loss along each hop.
C:\>ping: Ping is the most basic TCP/IP command, and it’s the same as placing a phone call to your best friend.
You pick up your telephone and dial a number, expecting your best friend to reply with “Hello” on the other end.
Computers make phone calls to each other over a network by using a Ping command.
The Ping commands main purpose is to place a phone call to another computer on the network, and request
an answer. Ping has 2 options it can use to place a phone call to another computer on the network. It can use
the computers name or IP address.
C:\>route: The route command displays the computers routing table. A typical computer, with a single network
interface, connected to a LAN, with a router is fairly simple and generally doesn’t pose any network problems. But if
you’re having trouble accessing other computers on your network, you can use the route command to make sure
the entries in the routing table are correct.
C:\>tracert: The tracert command displays a list of all the routers that a packet has to go through to get from the
computer where tracert is run to any other computer on the internet.
ping Test the network connection with a remote IP address ping-t [IP or host] ping-l 1024
[IP or host]
The -t option to ping continuously until Ctrl-C is pressed.
If you specify the -t option you can always get statistics without interrupting
pings by pressing Ctrl + Break
traceroute Displays all intermediate IP addresses through which a packet passes through, between the
local machine and the specified IP address.
tracert [@IP or host] tracert -d [@IP or host]
This command is useful if the ping command does return any data, to determine at
what level the connection failed.
-T Use TCP SYN for probes
-I Use ICMP ECHO for probes
-F Do not fragment probe packets.
-n Do not try to map IP addresses to host names when displaying -p n For UDP
tracing, specifies the destination port base traceroute
will use (the destination port number will be incremented by each probe). For ICMP
tracing, specifies the initial icmp sequence value (incremented by each probe too). For
TCP specifies just the (constant) destination port to connect.
-t tos For IPv4, set the Type of Service (TOS) and Precedence value. Useful values are
16 (low delay) and 8 (high throughput). Note that in order to use some TOS precendence
values, you have to be super user. For IPv6, set the Traffic Control value.
-w waittime Set the time (in seconds) to wait for a response to a probe (default 5.0
sec).
-q nqueries Sets the number of probe packets per hop. Default is 3
-A Perform AS path lookups in routing registries and print results directly after the
corresponding addresses.
-M method Use specified method for traceroute operations. Default traditional udp
method has name default, icmp (-I) and tcp (-T) have names icmp and tcp respectively.
Method-specific options can be passed by -O . Most methods have their simple
shortcuts, (-I means -M icmp, etc).
--mtu Discover MTU along the path being traced. Implies -F -N 1. New mtu is printed
once in a form of F=NUM at the first probe of a hop which requires such mtu to be
reached.
dig dig Get DNS information
dig domain
-p n Where n is the port number that dig will send its queries instead
of the standard DNS port number 53. This option would be used to test a
name server that has been configured to listen for queries on a non-
standard port number.
-x Perform a reverse lookup.
-t type Sets the query type to type. The default query type is "A",
unless the -x option is supplied to indicate a reverse lookup.
@IP/name Specify the name or IP address of the name server to query.
This can be an IPv4 address in dotted-decimal notation or an IPv6
address in colon-delimited notation.
Arp Arp ARP: Resolving IP addresses to MAC addresses. Displays and modifies
the translation tables of IP addresses to physical addresses used by the
ARP address resolution protocol.
ARP -s adr_inet adr_eth [adr_if] ARP -d adr_inet
[adr_if] ARP -a [adr_inet] [-N adr_if]
-a Displays active ARP entries by interrogating the current data protocol.
If adr_inet is specified, only the physical and IP addresses of the
specified computer are displayed. If more than one network interface
uses ARP, entries for each ARP table are displayed.
-g is the same as -a
adr_inet Specifies an internet address.
-N adr_if Displays ARP entries for network interface specified by adr_if.
-d Deletes the host specified by adr_inet.
-s Adds the host and associates the adr_inet internet address with the
adr_eth physical address. The physical address is given as 6 hexadecimal
bytes separated by hyphens. The entry is permanent.
adr_eth Specifies a physical address.
adr_if Specifies the internet interface whose address translation table
should be modified. When not specified, the first applicable interface
will be used.
© Anthonyconstant.co.uk 2020-2022 Windows Basic Command Prompt (Networking) Cheat sheet Command
Description Example ping ping is the primary TCP/IP command used to troubleshoot connectivity ping 192.168.1.1
tracert determines the path taken to a destination by sending Internet Control Message Protocol (ICMP) echo Request to
the destination tracert 192.168.1.1
gpupdate specifies that only User or only Computer policy settings are updated. By default, both User and Computer policy
settings are updated. Gpupdate
nslookup displays information that you can use to diagnose Domain Name System (DNS) infrastructure nslookup
netstat used without parameters, netstat displays active TCP connections netstat
ssh used by administrators of Linux and other non- Windows for cross-platform management of remote systems ssh
[email protected]
getmac returns the media access control (MAC) address and list of network protocols associated with each address
getmac
arp displays and modifies entries in the Address Resolution Protocol (ARP) cache arp /a systeminfo displays detailed
configuration information about a computer
With technology assuming an integral part of our everyday lives, being aware of the basic networking commands can go a
long way in improving productivity and efficiency. This blog is a quick guide to the commonly used computer networking
commands that can substantially streamline your experience using operating systems such as Windows and Linux. The
troubleshooter tools listed here can considerably improve your networking application and help you better appreciate the
digital interactions that have become a part of our daily lives in recent years.
Operating systems, such as Windows, MacOS, Ubuntu, or Linux, used for running computer systems can be described as
complex frameworks designed with executable programs that allow users to perform various tasks and are connected
together by various networking systems. Complex as networking systems are, they can run into system errors occasionally,
affecting the computer’s overall performance.
The basic networking commands are specifically designed for resolving such networking errors. Operating systems are
provided with command prompt tools that allow users to manually troubleshoot the operating system to diagnose networking
errors and solve them with minimum complexity.
Most networking command prompts in operating systems can be run in a text-based interface to perform executable tasks
as the user requests. Here are some ways that can allow users to trigger network command prompts.
Network commands can be activated from the Command Prompt option in the Windows Start Menu’s Windows
System Folder.
The Windows Key + R key allows users to enter the cmd function in the Run Box manually.
Network commands are also available under the Command Prompt and Command Prompt (Admin) options of the
Quick Link Menu and can be brought up using the Windows Key + X key.
Windows users can also run network command prompts in Windows Powershell, present in the Windows Start
Menu.
Advanced users can also toggle between Windows Powershell, Command Prompt, Azure Cloud Shell, and more
using the Windows Terminal, preinstalled on computers with the Windows 10 OS and above.
Network configuration commands have grown immensely popular due to their simplicity and efficiency in resolving
networking errors and can be easily operated by beginners. Networking commands are based on executable command-line
interfaces, where networking command prompts can be typed in to trigger the desired responses. The command prompts
serve as executable CLI programs and are used for the following reasons:
As CLI text-based programs, networking command prompts are easier to understand and use. Additionally,
networking commands are faster and can be efficiently used for troubleshooting and executing repetitive tasks.
Networking commands are popularly used because of their immense flexibility. They are stable and consistent and
can process complex operations with ease.
Networking commands for troubleshooting occupy substantially less memory and can process large-scale
operations with minimum CPU consumption.
The high precision and versatility make networking commands so popular among computer users. Networking
commands can be carried out with low resources without compromising their application.
Given the complexity of system functions, a data engineer or IT admin can use networking commands to execute
troubleshooting tasks efficiently, access website records, or check the status of networking servers.
Here are the top 10 networking commands that are popularly used for troubleshooting networking issues and gathering
system information:
1. IPCONFIG
ipconfig is undoubtedly one of the fundamental network commands used by data engineers and IT admins and has
remained one of the most efficient ways of troubleshooting network connectivity problems in Windows. Ipconfig’s
unparalleled simplicity in troubleshooting, analysing and configuring Window’s network connectivity issues makes it a
popular choice among system engineers.
Additionally, ipconfig can be seamlessly learnt by beginners, and its easy application is beneficial and can be carried out
without having to look up GUI (graphical user interface)-based guidelines, which can vary depending on the version of
Windows OS used. Mentioned below are some ways following which ipconfig can successfully be used at home, as well as
on business computers:
As one of the essential ipconfig commands, ipconfig /all is a prominently used network prompt that displays all
information associated with the network adapter’s configuration.
Using the ipconfig /displaydns prompt is helpful when bringing up the DNS resolver cache that contains information
on the IP addresses of websites already visited.
ipconfig /flushdns is an efficient prompt that allows users to remove obsolete DNS records from the DNS resolver
cache.
2. NSLOOKUP
Data engineers require frequent access to DNS (Domain Name System) troubleshooters and rely heavily on the nslookup
command for support. Although the nslookup command has limited use, it is convenient and efficient in accessing domain-
specific data, such as website records, web servers and IP address information.
nslookup comes with a straightforward interface and, in addition to Windows, is available for operating systems like Ubuntu,
Linux distros and MacOS. While most operating systems offer a preinstalled version of the nslookup command, users can
manually install the nslookup command as long as they are authorised as a sudo user. Here are some of the frequent uses
of nslookup Linux networking commands:
NSLOOKUP allows users to find and access domain and website-specific records with the $ nslookup -type=ns
[domain-name] command.
Start of Authority (SOA) domain information can be brought up using the $ nslookup -type=soa [domain-name]
command.
The $ nslookup -query=mx [domain-name] command allows users to check email servers and browse their MX
records.
3. HOSTNAME
For Linux users, hostname is a commonly used networking command in cmd that helps set and view the hostname
registered to a system. The hostname of a system is set permanently while installing the OS to a computer, connected over
a network, and can uniquely identify the system from others. While only users with root authority can set a hostname to a
system, it can still be accessed without using specific IP addresses. The hostname command prompt network command
offers the following prompts to its users:
The -a or –alias prompt allows users to display the host’s name as defined in the system.
-b or –boot prompts allow users with root authority to set a permanent hostname. The hostname is set to localhost
by default unless changed.
-d or –domain prompts can bring up the DNS domain name.
-F and –filename are used to list the hostname present in a file.
-I and -all-ip-addresses prompts can list all configured network addresses available on all host interfaces, and the -v
or –version command prompt displays information about the installed version.
4. PING
The ping command is a frequently used basic network command that allows users to test the network connectivity of a
system. The ping command is widely used to send a data packet to a specified IP address or a URL and calculate the time
taken for a response. Considering the streamlined yet effective application of the ping network command, it has remained a
popular troubleshooting tool used to measure network connectivity between the host system and specified IP addresses.
Ping network configuration commands are versatile and can detect connectivity in Windows, Linux and MacOS systems.
5. TRACERT
The tracert network command has grown popular among Windows OS users owing to its simple yet effective application.
One of the easiest networking commands in Windows, it can easily check a computer’s hostname and IP route. The tracert
command sends a data packet with the source and destination addresses, evaluating the network status accordingly.
Currently, the tracert command serves as a diagnostic software that comes pre-installed in computers and is predominantly
used by network administrators. The prompt $ tracert domain.com launches the tracert network command in Windows.
6. NETSTAT
As one of the most commonly used network commands, the netstat command evaluates and displays the network status. It
is most commonly used as a basic network command and is majorly used for determining network issues rather than just
checking the network status. Additionally, as netstat command prompt network commands can count data packets that
have been transmitted, it is an efficient way of supervising network traffic and can determine if there is any network
congestion that can lead to slower performance.
7. ARP
ARP, or the Address Resolution Protocol, is one of the most commonly used networking commands in cmd used in a local
area network for mapping a computer’s IP address to another computer’s physical MAC address. Using the arp -a
command, a user can display or modify the local ARP cache. The arp prompt also allows users to track ARP cache entries
for specific IP addresses.
8. SYSTEMINFO
The systeminfo network command is an easy-to-use networking command in Windows that can efficiently display system
information and other Windows configurations. Systeminfo comes built-in with the Windows OS and, when launched, can
bring up a list of information with operating system details, hardware and software configuration, version information, and
other details, such as RAM and processor consumption, IP and MAC addresses.
9. PATHPING
The pathping command prompt comes pre-installed in Windows OS and is an alternative to the tracert Windows network
command. Although less widely known, the pathping command is an effective utility tool for evaluating network performance
and latency issues. Like the ping command, pathping also uses data packets to evaluate the network performance and can
trace the hops between the source and destination addresses. The pathping network command can be implemented with a
simple pathping -n [domain.com] prompt.
10. GETMAC
The Windows OS comes with the getmac network command pre-installed that allows Windows users to gather all necessary
information about the Media Access Control (MAC) address of their computer. The getmac command can also display a list
of all network protocols with the addresses for cards in the system, whether available through wired, optical or remote
mediums. The getmac command also allows users to monitor any transmission within a network segment.
Conclusion
Whether you’re a data engineer or a network administrator, having a grasp of the frequently used networking commands
can go a long way in helping you gather detailed information about how your computer functions. Furthermore, network
troubleshooting commands can also help you manage your network devices efficiently, enhancing your productivity in no
time. Enroll in relevant programs and online courses to master networking commands and bolster your resume.
Tracert is a simple yet efficient network troubleshooting command frequently used by data engineers to trace internet
addresses. Tracert is commonly used in computers with a Microsoft Windows OS and can be executed directly from the
command prompt window, available with the Windows key + R shortcut. Traceroute, the Tracert equivalent for MacOS and
Unix-based operating systems, can be executed from Network Utility.
Ipconfig is a popularly used network configuration command for troubleshooting and network configuration. Ipconfig can
display the IP address and any subnet masks for network systems on Windows.
The versatility of the Linux operating system makes it a comfortable choice for networking among data scientists and
programmers. Linux networking commands can effectively run several servers ranging from smaller home office servers to
larger data centre variants without any compromise in its output. Also, Linux is cost-effective, making it easier without
relying on expensive Windows servers.
Ping is one of the frequently used network commands to detect the accessibility of a particular IP address. While Ping is a
competent and efficient network command, Tracert has emerged as a better computer networking command for detecting
network accessibility in recent years. Additionally, Tracert can troubleshoot complex network issues such as hop delays,
network misconfigurations and congestion.
route print: In order to view the entire contents of the IP routing table.
route delete: In order to delete all routes in the IP routing table.
route add: In order to add a static TCP/IP route to the IP routing table.
Ver 13.1 1
26.2 Network setup
Open NetSim and click Examples > Experiments > Basic-networking-commands-Ping-
26.3 Procedure
The following set of procedures were done to generate this sample:
Ver 13.1 2
Step 1: A network scenario is designed in NetSim GUI comprising of 2 Wired Nodes and 3
Routers in the “Internetworks” Network Library.
Step 2: In the Network Layer properties of Wired Node 1, “ICMP Status” is set as TRUE.
Similarly, ICMP Status is set as TRUE for all the devices as shown Figure 26-3.
Step 4: Right click on the Application Flow App1 CBR and select Properties or click on the
Application icon present in the top ribbon/toolbar.
A CBR Application is generated from Wired Node 1 i.e. Source to Wired Node 2 i.e. Destination
with Packet Size remaining 1460Bytes and Inter Arrival Time remaining 233.6µs. Transport
Protocol is set to UDP.
Additionally, the “Start Time(s)” parameter is set to 30, while configuring the application. This
time is usually set to be greater than the time taken for OSPF Convergence (i.e., Exchange of
OSPF information between all the routers), and it increases as the size of the network
increases.
Step 5: Packet Trace is enabled in NetSim GUI. At the end of the simulation, a very large .csv
file is containing all the packet information is available for the users to perform packet level
analysis. Plots are enabled in NetSim GUI.
Step 6: Click on Run Simulation. Simulation Time is set to 300 Seconds and in the Runtime
Ver 13.1 3
Figure 26-4: Runtime Interaction window
NOTE: It is recommended to specify a longer simulation time to ensure that there is sufficient time for the
user to execute the various commands and see the effect of that before the Simulation ends.
Simulation (NetSimCore.exe) will start running and will display a message “waiting for
Ver 13.1 4
Figure 26-6: Select NetSim Console
Now Client (NetSimCLI.exe) will start running and it will try to establish a
connection with NetSimCore.exe. After the connection is established, the following
will be displayed Figure 26-7.
Ver 13.1 5
Figure 26-8: Pinging Wired_Node_2
route print
Ver 13.1 6
So, to delete the route with destination network 11.5.1.2, all we’d have to do is type this
command.
To check whether route has been deleted or not check again using route print command.
To add a static route to the table, you will type a command using the following syntax.
So, for example, if you wanted to add a route specifying that all traffic bound for the
11.5.1.2 subnet went to a gateway at 11.5.1.1
If you were to use the route print command to look at the table now, you’d see your new
static route.
Ver 13.1 7
NOTE: Entry added in IP table by routing protocol continuously gets updated. If a user tries to remove a
route via route delete command, there is always a chance that routing protocol will re-enter this entry again.
Users can use ACL / Static route to override the routing protocol entry if required.
[PERMIT, DENY] [INBOUND, OUTBOUND, BOTH] PROTO SRC DEST SPORT DPORT IFID
Ver 13.1 8
Figure 26-11: Application properties window
Use the command as follows Figure 26-12.
NetSim>acl enable
ACL is enable
NetSim>aclconfig
ROUTER_3/ACLCONFIG>acl print
Usage: [PERMIT, DENY] [INBOUND, OUTBOUND, BOTH] PROTO SRC DEST SPORT
DPORT IFID
Ver 13.1 9
ROUTER_3/ACLCONFIG>DENY BOTH UDP ANY ANY 0 0 2
OK!
OK!
ROUTER_3/ACLCONFIG>print
ROUTER_3/ACLCONFIG>exit
NetSim>acl disable
ACL is disable
NetSim>
Ver 13.1 10
Figure 26-13: Packet Trace - ICMP Control Packets
In Wireshark, apply filter as ICMP. we can see the ping request and reply packets in Wireshark
as shown Figure 26-14.
Ver 13.1 11
Figure 26-15: IP Metrics Table in result window
NOTE: Number of packets blocked may vary based on the time at which ACL is configured.
Users can also observe this in Packet Animation before and after the Packets are blocked as
shown below Figure 26-16/Figure 26-17.
Figure 26-16: In Animation Window before applying ACL rules see the packet flow
Ver 13.1 12
Figure 26-17: In Animation Window after applying ACL rules see the packet flow
Check Packet animation window whether packets has been blocked in Router_3 or not
after entering ACL command to deny UDP traffic.
Before applying ACL rule there is packet flow from Wired_Node_1 to Wired_Node_2
Ver 13.1 13