ping ss route netstat command

ping ss route netstat command

Useful command To Checking Connectivity of Network  -
  • ping
  • ss
  • netstat
  • route
  • tcmpdump
  • wireshark
  • munin
  • cacti
Ping - to use ping command for checking IP or host or network is reachable or not

Ex-  ping < network )
# ping 
SS - socket statistics  - to know all information about TCP/UDP Connection , Established Connection  , protocol , TCP socket etc.

# ss 


-a = Display all info

-l = Display all open port/socket

-o = Show time info

-m = Show memory info

-p = Show process info

-i = Show internet TCP/IP information

-r = Resolve host name

-4 = Display only IPv4 socket

-6 = Display only IPv6 socket

Netstat - t o see the information about network connection , routing table , interface etc.

# netstat

-t   = display all tcp connection

-u  = display all UDP connection

-r  = display all routing table

-s =  display networking statistics

-v = verbos mode

-l   = list all open socket

-a = all

-o = display time

route   =  to see the routing table  , add new route etc

# route

-v, --verbose           be verbose

-n, --numeric          don t resolve names

-e, --extend            display other/more information

-F, --fib                  display Forwarding Information Base (default)

-C, --cache            display routing cache instead of FIB

To add default getaway

# route  add  default  gw
To set route for 2 different network

For example , we have 2 eth one is direct broadband connection establish by modem  & second eth1 we gave IP & netmask we do not give gateway

To add route command

#route  add  -net < network>  netmask <netmask>  gw <getaway>
Ex - # route  add  -net  netmask  gw 
Ex - # route  add  -net  netmask  gw 
To reject particular host/IP/Network

# route add -host  reject
Tcmpdump - is an command-line packet capture and analyzer tool for monitoring network traffic.

# yum install tcpdump

# tcpdump
Specific interface

# tcpdump -i eth0
Display Available interface

# tcpdumb -D
Capture packet in ASCII Format

# tcpdump -A -i eth0
Capture packet in HEX & ASCII Format

# tcpdump -XX -i eth0
Capture packet & save in file : here *.pcap is file format

# tcpdump -w 0001.pcap -i eth1
Read capture packet file

# tcpdump -r 0001.pcap
Capture IP Address Packet

# tcpdump -n -i eth0
Capture TCP Packet

# tcpdump -i eth0 tcp
Capture packet form specific port

# tcpdump -i eth0 port 22
Capture packet form source IP

# tcpdump -i eth0 src
Capture packet form Destination IP

#tcpdump -i eth0 dst

Wireshark - is an open source network protocol analyzer that is used to troubleshoot network related issues.

# yum install wireshark*

Munin - is an web based network and system monitoring application that is used to display results in graphs using rrdtool.

Next Post »