Exp1 Commands
Exp1 Commands
• Two basic commands are provided by most Unix systems for network configuration and
administration, and can be used to discover some details of a network: netstat and ifconfig.
• netstat
• netstat command displays various network related information such as network connections,
routing tables, interface statistics, masquerade connections, multicast memberships etc.
• netstat -a : To show both listening and non-listening sockets.
• netstat -at : To list all tcp ports
• netstat -au : To list all udp ports
• netstat -l : To list only the listening ports.
• netstat -lt : To list only the listening tcp ports
• netstat -lu : To list only the listening udp ports
• netstat -lx : To list only the listening UNIX ports
• netstat -s : To list the statistics for all ports
• netstat -st : To list the statistics for TCP ports.
• netstat -su : List the statistics for UDP ports
• netstat -pt : To display the PID and program names
• netstat -c : To print the netstat information continuously
• netstat -r : To get the kernel routing information
• netstat -ap | grep ssh : To get the port on which a program is running.
• netstat -i : To get the list of network interfaces
• netstat -ie : To display extended information on the interfaces
• ifconfig