How to Configure,Troubleshoot and Debug the network in linux.

In Linux we have multiple commands to configure, troubleshoot & debugging the network by using command line interface. We have facing multiple issues is system like issue in creating, modification, configuration & installation. The system administration have permission to troubleshoot & debug the problems.

Network troubleshooting is a form of problem solving & used to identify, diagnose and solve problems within a network. It’s a process that network engineers use to resolve network problems and improve network operations.

Network Debugging is the process to solve the problem, such as removing an error on the computer.

Network Configuration, Troubleshooting and Debugging Tools:

Traceroute Command

  • It is a network troubleshooting & used to show how the data transmitted from a local machine to a remote machine.

Install Traceroute on Linux.

apt-get install inetutils-traceroute 
or
apt-get install traceroute   

Trace the route of a connected network host, pass the name of the server or IP address.

traceroute ip-address
or
traceroute site-name (google.com)

Trace the Route Using IPv6.

traceroute6 site-name (google.com)  

Trace the Route Using Ipv4.

traceroute 4 google.com  

Here is the command output.

root@ip-172-38-15-38:/home/ubuntu# tracerout6 google.com
traceroute to google.com (2404:6800:4002:819::200e) from 2409:4053:2e1f:cbf4:fe9e:abc0:23ea:4ba7, 30 hops max, 24 byte packets
 1  2409:4053:2e1f:cbf4::f1 (2409:4053:2e1f:cbf4::f1)  2.9979 ms  1.3029 ms  2.3878 ms
 2  * * *
 3  2405:200:339:eeee:20::378 (2405:200:339:eeee:20::378)  41.7068 ms  38.2591 ms  20.5682 ms
 4  2405:200:801:2a00::d2 (2405:200:801:2a00::d2)  27.9288 ms  52.4210 ms  36.8843 ms
root@ip-172-38-15-38:/home/ubuntu# tracerout 4 google.com
traceroute to google.com (142.250.193.14), 64 hops max
  1   192.168.84.1  2.731ms  0.855ms  1.096ms 
  2   *  *  * 
  3   56.8.14.105  42.992ms  56.8.14.81  40.699ms  59.790ms 
  4   192.168.22.72  39.883ms  192.168.11.66  38.753ms  40.994ms 
  5   192.168.22.73  38.719ms  40.922ms  52.919ms 

Disable ip address & host-name mapping.

traceroute n google.com  

MTR Network Diagnostic Tool:

  • It is a modern command line network diagnostic tool that provide the same functionality of ping and traceroute into a single diagnostic tool.enp0s3
mtr google.com
or
mtr ip-address

Here is the command output.

Fig 1

Tracepath

  • It is similar to traceroute command & doesn’t require root privileges.
tracepath site-name/<destination>  

Route Command

  • It is acommand line utility for displaying the IP routing table of a Linux system.
route

Here is the command output.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    600    0        0 wlp0s20f3
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 wlp0s20f3
192.168.23.0    0.0.0.0         255.255.255.0   U     600    0        0 wlp0s20f3

Ping Command:

  • stands for Packet Internet Groper. It is a command line utility used for testing connectivity between two systems on a network.
ping ip-address

nmcli Command:

  • It is a command-line tool to report network status, manage network connections, and control the Network Manager.
nmcli dev status

Here is the command output.

DEVICE             TYPE      STATE         CONNECTION 
wlp0s20f3          wifi      connected     wifi-connection

Check network connections on system.

nmcli con show

Check only the active connections.

nmcli con show -a

ifconfig Command:

  • It is a command line interface tool for network interface configuration.
ifconfig

List all interfaces.

ifconfig -a 	

IP Command:

  • It is a command line utility for displaying routing, network devices, interfaces.
ip addr show

ifup, ifdown, and ifquery command:

  • It is a command line utility for enable & disable the interface.
ifup eth0
&
ifdown eth0
  • Ifquery used to parse the network interface configuration.
ifquery eth0

Ethtool Command:

  • It is a command line utility for querying and modifying network interface device drivers.
ethtool interface-name

 

Leave a Reply