5 Essential Network Commands for Linux and Windows

Nowadays, administrators work with more diverse platforms than ever before. From Windows workstations to Linux servers to macOS laptops, they encounter an astonishing number of environments. Cloud and container computing take this complexity to another level. It’s hard enough for administrators to remember all the shell commands for their platform of choice, let alone those required for another operating system. Add cloud services, and the task becomes more and more difficult.

This article provides a list of common commands for managing network services, sorted by task and not by platform. First defines a task and then displays standard Linux and Windows commands for managing a service or utility. The goal is to provide a cross-platform reference that helps all administrators.

First, I display the commands that define the system, followed by the Dynamic Host Configuration Protocol (DHCP) lease management commands. Next, I introduce the network connections and name resolution test. Finally, I cover the commands to test the network connection. Administrators can use these commands on their physical and virtual networks to verify the correct configuration and troubleshoot connectivity issues.

1. Define the system

One of the most basic commands to select the local system is hostname Command. This command works on Linux and Windows systems. It might not be exciting, but at least it’s consistent.

Another common task is to display the system IP address. Linux has changed in the past few years, moving away from ifconfig command to IP The matter – more specifically, IP. In a traditional Windows command prompt, ipconfig Displays basic IP address information for the system, although administrators can also use Get-NetIPAddress cmdlet in the PowerShell window.

Linux commands:

hostname
ip addr

Old Linux command:

ifconfig

Windows commands:

hostname
ipconfig
Get-NetIPAddress

2. DHCP Client Management

Administrators often need more information about how the system obtained the IP address configuration. Most workstations rent an IP address from a DHCP server. Sometimes it is necessary to acquire a new composition. Linux administrators usually accomplish this with a file dhclient command, while their Windows counterparts use files ipconfig with the /release And / renewal keys.

Linux commands:

Edit the current configuration

dhclient -r

Obtaining a new lease agreement

dhclient

Windows commands:

Edit the current configuration

ipconfig /release

Obtaining a new lease agreement

ipconfig /renew

3. View current network connections

Both systems recognize netstat The command to display the current connections to the system. Many Linux administrators prefer to use the . extension ss The thing is, but that’s a personal preference. There are plenty of options to narrow the output to only the information that administrators need. To view these options in Linux, use –help or guide page. On Windows, try /? Transformation.

Linux and Windows command:

netstat

Linux command:

ss

4. Name resolution test

Name resolution is one of the most important services on the network. Name resolution associates easy-to-remember hostnames with hard-to-remember IP addresses. The DNS service hosts a dynamic database of resource records that tracks names and IP addresses.

No matter which platform administrators prefer, they should be aware that all network nodes share common configuration requirements and troubleshooting needs.

When clients cannot access DNS servers, they may not be able to check email, access data stored on remote file servers, or print or access requested web pages. Troubleshooting name resolution is a common task.

It is interesting that Linux and Windows systems share one of the main utilities: nslookup. Originally a Linux tool, nslookup It is included with Windows. It enables administrators to create manual DNS queries as part of troubleshooting. Linux also depends on two other things, dig And Host, to troubleshoot DNS. Windows administrators can use a file Resolve-DnsName PowerShell cmdlet to accomplish the same thing.

Linux commands:

nslookup {remote-system}
dig {remote-system}
host {remote-system}

Windows commands:

nslookup {remote-system}
Resolve-DnsName -Name {remote-system}

5. Test the network connection

Another common task is to test the connection and check the path that network traffic takes. The traditional tool for that is ping. Linux and Windows both recognize a file ping The command, though, that Linux sends continuous pings by default, Windows only sends four, unless told otherwise.

Both platforms also share tracing path although Windows spelled it tracert. This tool shows routers, or hops, the packets that pass through them while traversing the network. This information lets administrators know where packets are going and identify potential network performance issues, saturation, or outages. PowerShell can do the same with a file Test-NetConnection -Computername server01 -TraceRoute cmdlet.

Linux commands:

ping {destination}
traceroute {destination}

Windows commands:

ping {destination}
tracert {destination}
Test-NetConnection -Computername {destination} -TraceRoute

is contained

No matter which platform administrators prefer, they should be aware that all network nodes share common configuration requirements and troubleshooting needs. Windows networking has its roots in ancient Unix implementations of the TCP/IP protocol, and thus, many commands are shared or at least the same. In fact, macOS also shares many of the Linux commands mentioned above.

Whether administrators connect to a remote Linux server in the cloud from their Windows admin workstation or use the Secure Socket Shell from their Linux laptop to access a local Windows server, they’ll discover many commands that collect network information are similar. Administrators can learn these commands to increase their versatility and flexibility as an administrator.

Leave a Comment

Your email address will not be published.