Linux: Network Commands
These four commands answer the everyday questions: what is my address, can I reach that host, and what is listening?
Your own addresses
ip # modern: interfaces, addresses, /prefix
ifconfig # classic view of the same information
Look for your interface (often eth0), its inet address, and the /24-style prefix you learned to read in the subnetting lesson.
Can I reach it?
ping example.com
ping sends small ICMP echo packets and times the replies. Replies with low, steady times mean a healthy path. No replies can mean the host is down, or simply that a firewall drops ICMP, absence of a reply is not proof of absence.
What is listening?
ss # sockets: what is listening and what is connected
netstat # older tool, similar output
The LISTEN state means a service is waiting for connections on that port. This is the inside view of the same thing nmap shows from the outside, comparing them is a great habit.
Try it
ip, then ping example.com, then ss. You are now reading a host's network identity and exposure with three commands, the daily bread of recon.