Networking is a core skill for cybersecurity professionals. Understanding how Linux communicates over networks, how to diagnose connectivity issues, and how to inspect traffic is essential for system administration, penetration testing, and incident response.
This module covers basic networking concepts and Linux commands to monitor and troubleshoot networks.
An IP address is a unique identifier assigned to a device on a network. It allows computers to communicate with each other.
| Component | Description |
|---|---|
| Network part | Identifies the network |
| Host part | Identifies a device on the network |
| Subnet Mask | Defines the range of IP addresses in the network |
Cybersecurity professionals need to understand IPs for:
Linux provides commands to view and configure network interfaces.
ifconfig (deprecated on some systems)ifconfig
Output shows:
Bring an interface up or down:
sudo ifconfig eth0 up
sudo ifconfig eth0 down
ip (modern replacement for ifconfig)ip addr show
Shows IP addresses for all interfaces.
Bring interface up:
sudo ip link set eth0 up
Bring interface down:
sudo ip link set eth0 down
Check routing table:
ip route
pingThe ping command checks if a host is reachable and measures latency.
Example:
ping 8.8.8.8
Output shows:
Stop pinging with:
Ctrl + C
Ping a domain name:
ping google.com
This tests both connectivity and DNS resolution.
Linux provides commands to analyze the path and status of network connections.
traceroutetraceroute shows the route packets take to reach a destination.
Install if needed:
sudo apt install traceroute
Run traceroute:
traceroute google.com
Output shows each hop and its response time. Useful for detecting network bottlenecks.
netstatnetstat displays active connections, listening ports, and routing tables.
Check listening ports:
netstat -tuln
Options:
-t → TCP connections-u → UDP connections-l → Listening ports-n → Show numeric addressesAlternative modern command:
ss -tuln
Open ports indicate services listening on the network. This is crucial in cybersecurity to detect potential vulnerabilities.
Example: Check open ports on localhost
sudo netstat -tulpn
Output shows:
DNS translates domain names into IP addresses. Linux provides tools to query DNS servers.
nslookupnslookup google.com
Output shows:
digdig provides detailed DNS information.
dig google.com
Output includes:
Example: Check MX records (mail servers):
dig google.com MX
Networking skills help professionals:
Understanding networking in Linux is critical before using advanced security tools like Nmap, Wireshark, or Metasploit.
Students should now understand:
ifconfig and ippingtraceroutenetstatnslookup and digThese skills provide the foundation for network monitoring, troubleshooting, and cybersecurity tasks.