0% found this document useful (0 votes)
3 views4 pages

Linux network commands

The document explains how to use the Netstat command in Linux to troubleshoot networking issues by displaying network connections, routing tables, and protocol statistics. It provides various syntax examples for checking connections on specific ports, listing sockets, and viewing routing tables. Additionally, it introduces the Traceroute command for tracking data routes and includes instructions for installation and usage options.

Uploaded by

satyaachilukurii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Linux network commands

The document explains how to use the Netstat command in Linux to troubleshoot networking issues by displaying network connections, routing tables, and protocol statistics. It provides various syntax examples for checking connections on specific ports, listing sockets, and viewing routing tables. Additionally, it introduces the Traceroute command for tracking data routes and includes instructions for installation and usage options.

Uploaded by

satyaachilukurii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

How to Use Netstat Command to Troubleshoot Networking Issues in Linux

Netstat is a command-line network utility that displays:

• network connections for TCP,UDP

• routing tables,

• a number of network interface,

• network protocol statistics

Case: To identify number of connection on a given port or IP ..

syntax: netstat -putan |grep <port /ip>

eg: netstat -putan |grep :22 [[use for ssh]

[ p=PID programme,t=tcp,u=udp,n=numerical addr,l=listening port,a=all]

1. To see all the sockets


netstat -a

2. List all the TCP ports


netstat -at

3. List all the TCP v6 ports


netstat -6at

4. List all the UDP ports


netstat -au

5. List all Listening ports


netstat -al [all listening port]

6. To view the numerical address


netstat -ln

7. To view the PID of the programme of connection


netstat -p

8. To view the routing table


netstat -r
9. To check no. of connection from a specific IP
netstat -an | grep <IP>

10. To get the list of all the interface


netstat -i

11. Which port a process is using?


netstat -ap | grep <process_name>

12. How to see statistics by protocol?

netstat -s

Traceroute Command:
Tracks the route packets on how the data travels on internet from the computer to
destination.

The only required parameter is the name or IP address of the destination host.

syntax: $traceroute IP
This is how data transfer from one server to another server.

By default traceroute is not installed in linux system ,so you can install in ubuntu as:

sudo apt-get install traceroute

Or

sudo yum install traceroute ,,,for redhat distribution

eg: traceroute www.google.com

Some other options for traceroute command:

• Default packet length is 60 byte to change it to 100 then


traceroute google.com 100

• Default no. of paket per hop is 3, to change it

traceroute -q 1 google.com

• Default port is 33434 , to change it to another port

traceroute -p 21101 google.com

• To use IPV6 or 4

traceroute -4/6 google.com

You might also like