Lab
Netstat:-
Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. It prints the information related to Linux networking subsystem. It shows which ports are open & close, it is most useful command for network troubleshooting. This command is useful for network administration & system administration people.
Option:-
1. netstat
netstat displays a list of open sockets. If you don't specify any address families, then the active sockets of all configured address families it listed
Its output like that but much big in length so just pipe it with more so you can go thgough all the list.
2. netstat –t
it shows list of programs which already have established TCP connection but, not those which are waiting for TCP connection
3. netstat –a
it shows list of listening & non listening sockets.
4. netstat –at
it list out all the programs which are listening & established TCP connection only.
5. netstat –u
it list out all the programs which have already established UDP connection only not listening one.
Right now i don’t have any established UDP connection on my machine.
6. netstat –au
it list out all the programs which are listening & established UDP connection only.
7. netstat –l
it shows all listening sockets.(whose which are omitted by default)
8. netstat -s
Display summary statistics for each protocol. Default protocol list are TCP,UDP,ICMP & IP.
9. netstat –r
Dispaly kernel IP routing table.
10. netstat –i
Display kernel interface table. It shows network interface packet usage with MTU size.
11. netstat –c
It print the netstat information continuously. If we menstion no along with then it print after that much duration of time
12. netstat –p
IT shows the list of services with their PID no which uses network sockets.
13. netstat –pa | grep ssh
It displays the which programs are listening on specified port.
14. netstat –g
It displays the multicast gropup membership information for IPv4/IPv6
15. netstat –F
Print routing information from the FIB. (This is the default.)
16. netstat –n
Show numerical addresses instead of trying to determine symbolic host, port or user names.
17. Netstat –M
Display a list of masqueraded connections.
18. netstat –V
shows the current version of netstat on system.