Skip to content
Published May 6, 2019

Introduction

Network monitoring and troubleshooting is an essential part of any Network administrator. There are lots of tools available in the market to troubleshoot a variety of different network conditions.

In this tutorial, we will discuss some commonly used Network Troubleshooting Tools that will help you diagnose most networking issues.

PING

PING also known as a “Packet Internet Groper” is a most commonly used network tool that can be used to provide a basic connectivity test between the source host and a destination host. PING uses an ICMP protocol to send an echo packet to a destination host and a mechanism to listen for a response from this host.

You can use ping command with hostname or IP address as shown below:

You can also use ping with -c option to exit after a specified number of request:

Ifconfig

ifconfig is a command line tool that reports the IPv4 and IPv6 addresses, subnets, and default gateways for all network adapters on your system. You can also assign IP address, enable and disable network interface with this command.

You can list IP address of all the network interface connected to your system with the following command:

You can list IP address of specific interface with the following command:

You can assign an IP address to specific interface with the following command:

ifconfig wlan0 192.168.0.123 netmask 255.255.0.0

You can also disable and enable network interface with the following command:

To enable interface wlan0:

ifup wlan0

To disable interface wlan0

ifdown wlan0

NETSTAT

Netstat is a command line tool that can be used to displays active connections on your system both incoming an outgoing.. Netstat is very useful when verifying the status of a listening port on a system and see what remote systems are connected to a local host on a specific port.

You can see all the active connections on your system with the following command:

You can also see routing table information with the following command:

DIG

Dig also known as “domain information groper” is a command line tool that can be used to verify DNS resolution. You can troubleshoot DNS related query and see DNS related information like A Record, CNAME, MX Record with the help of Dig command.

You can look up the A records for the domain name google.com with the following command:

You can look up the MX record for the domain name google.com with the following command:

You can look up all the record for the domain name google.com with the following command:

NSLOOKUP

nslookup is another command line tool to query and verify DNS name resolution. It can be used to obtain domain name or IP address of computers in the internet.

You can use nslookup with the domain name to display the “A Record” (IP Address) of the domain:

You can also do the reverse DNS look-up by providing the IP Address with nslookup command:

You can see NS records of domain google.com with the following command:

You can see MX records of domain google.com with the following command:

ROUTE

Route is a command line tool that can be used to show/manipulate the IP routing table. You can also setup static routes to specific host or networks via an interface.

You can use route command without any argument to see the details of the kernel routing table entries.

You can add the routing entry with the following command:

route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.0.100

You can add the default gateway with route command as shown below:

route add default gw 192.168.0.100

You can also delete the default gateway with the following command:

route del default gw 192.168.0.100

If you want to reject routing the packets to a particular host/network, run the following command:

route add -host 192.168.0.201 reject

HOST

Host is a simple command line utility for performing DNS lookups. It can be used to convert names to IP addresses and vice versa.

You can use host command without any argument gives a brief description about each option:

You can resolve domain name to IP address and IP address to domain name with the following command:

You can use host command with -t to see the NS records of domain google.com:

To print all the details of domain google.com with the following command:

ARP

ARP also known as “Address Resolution Protocol” is a very useful tool to find IP to MAC address mappings. It is also used to manipulates or displays the kernel’s IPv4 network neighbor cache.

Use arp without any argument will display the current content of the table.

You can find the MAC address of specific host with the following command:

arp 192.168.0.1

You should see the following output:

Address HWtype HWaddress Flags Mask Iface
192.168.0.1 ether c8:3a:35:59:49:b0 C wlan0

You can list all the options available with arp command as shown below:

ETHTOOL

The ethtool is a command line tool to display and change the Ethernet adapter settings. Using ethtool, you can change network card speed, auto-negotiation, duplex mode and wake on LAN setting.

You can use ethtool command with network interface card (enp0s3) to displays ethernet card properties as shown below:

You can also see driver information of network interface card (enp0s3) as shown below:

IWCONFIG

iwconfig is a command line tool that can be used to configure and manage your wireless network interface.

You can your wireless network information with the following command:

You can list all the options available with iwconfig as shown below:

HOSTNAME

hostname is a command line tool used to see the hostname of your system.

Run the following command to see the hostname of your system

hostname

You should see the following output:

ubuntu1804

You can list all the options available with hostname command as shown below:

You can see all the information about your host with the following command:

hostnamectl status

You should see the following output:

Static hostname: ubuntu1804
Icon name: computer-vm
Chassis: vm
Machine ID: 9ce42836ca1e4a63959b17e47fca28e8
Boot ID: 0a63735b83e746609eacb75652f34994
Virtualization: oracle
Operating System: Ubuntu 18.04.1 LTS
Kernel: Linux 4.15.0-47-generic
Architecture: x86-64

You can also set hostname of your system with the following command:

hostnamectl set-hostname newhostname

Conclusion

I hope, you have now enough knowledge to use the above tools to manage and troubleshoot network related problems. These tools can help you to fix a network related problems in minimal time.

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *