Debug School

rakesh kumar
rakesh kumar

Posted on

Troubleshooting using Netstat

step 1: first check network connectivity using ping

ping 192.168.0.1
Enter fullscreen mode Exit fullscreen mode

Image description
step 2: first check port no if everything fine or webserver is acessible

Image description
Image description
Image description

step 3: kill process which is using port 12345

kill -9 $(lsof -t -i:"Port Number")
kill -9 $(lsof -t -i:"12345")
Enter fullscreen mode Exit fullscreen mode

or

# get the PID of the process
sudo lsof -i:3000

# use the PID from above command and stop the process
sudo kill PID
Enter fullscreen mode Exit fullscreen mode
Some times the process does not terminate by simply using kill. Use -9 flag to force stop the process as

sudo kill -9 PID
Enter fullscreen mode Exit fullscreen mode

NOW,it is acessible

Image description

Some Usefull Questions on LINUX

netstat-command
Refrence
what do you mean by port are listening or established.
Find a Process That Is Using a Particular Port*(IMP).
what do you mean by local and foreighn address.
syntax to list All Ports and Connections,List All TCP Ports,List All UDP Ports,List Only TCP or UDP Listening Ports,Display statistics for all ports regardless of the protocol,Statistics for UDP/TCP Ports.
Display Numerical Addresses, Host Addresses, Port Numbers.
Display PID to specific port connection .
how to print netstat information every second.
how to List All netstat Commands
**netstat-command-2618098
*
Show Specific Connections Only
Show Active TCP Connections and Process Identifiers

Top comments (0)