Lab 04 — Linux Networking
Linux networking is one of the most important skill areas for:
Linux Administrators
Cloud Engineers
SOC Analysts
Security Engineers
Cloud Security Engineers
DevOps Engineers
Incident Responders
Penetration TestersIn the previous labs, you worked with:
Linux Administration ↓Linux Hardening ↓Linux IAMNow you will understand how the Linux server communicates.
Your mission is to move from:
"The Network Is Not Working"to:
Interface ↓Address ↓Subnet ↓Route ↓Gateway ↓DNS ↓Port ↓Firewall ↓ApplicationMission Information
Section titled “Mission Information”Lab: Linux Networking
Level: Beginner → Intermediate
Estimated Time: 120–180 minutes
Environment: Authorized Linux VM or disposable lab server
Primary Role: Linux / Network Administrator
Secondary Roles: SOC Analyst, Security Engineer, Cloud Engineer, DevSecOps Engineer
Mission Scenario
Section titled “Mission Scenario”Your organization has deployed a Linux application server.
Users report intermittent connectivity problems, and the security team also wants confirmation that the server exposes only required network services.
You have been asked to perform a Linux network assessment.
You must determine:
Which Interfaces Exist?
Which IP Addresses Are Assigned?
Which Networks Are Connected?
Where Is the Default Gateway?
How Is DNS Configured?
Which Services Are Listening?
Which Connections Are Active?
Which Firewall Controls Exist?
Can Required Destinations Be Reached?
Is Anything Unexpected Exposed?You will finish by producing a professional Linux networking assessment report.
Learning Objectives
Section titled “Learning Objectives”By completing this lab, you should be able to:
- Identify Linux network interfaces
- Understand interface states
- Review IPv4 and IPv6 addresses
- Understand subnet and CIDR concepts
- Review routing tables
- Identify the default gateway
- Understand ARP and neighbor discovery
- Review DNS configuration
- Test DNS resolution
- Understand TCP and UDP
- Identify listening ports
- Identify established connections
- Map ports to processes
- Review host firewall configuration
- Understand loopback and wildcard bindings
- Test network connectivity systematically
- Troubleshoot common Linux network problems
- Investigate suspicious network activity
- Document network-security findings
Lab Architecture
Section titled “Lab Architecture” Internet / Network | | +-----+-----+ | Gateway | +-----+-----+ | Local Network | +-----------+-----------+ | | v v +---------------+ +---------------+ | Linux Server | | Other Systems | | | | | | Interface | | DNS | | IP Address | | Applications | | Routes | | Services | | DNS | +---------------+ | Firewall | | Services | +---------------+Linux Networking Mental Model
Section titled “Linux Networking Mental Model”Always think in layers:
APPLICATION ↓PORT ↓TCP / UDP ↓IP ↓ROUTING ↓NETWORK INTERFACE ↓NETWORKWhen something fails, identify:
Which Layer Failed?instead of immediately restarting services.
Part 01 — Prepare the Lab
Section titled “Part 01 — Prepare the Lab”Create your workspace:
mkdir -p ~/linux-networking-labEnter it:
cd ~/linux-networking-labCreate:
mkdir baseline evidence findingsStep 01 — Identify the System
Section titled “Step 01 — Identify the System”Run:
hostnameThen:
cat /etc/os-releaseThen:
uname -rRecord:
Hostname:
Distribution:
Kernel:
Date:Step 02 — Capture Initial Network Baseline
Section titled “Step 02 — Capture Initial Network Baseline”Run:
ip -brief addressSave:
ip -brief address > baseline/interfaces.txtThen:
ip route > baseline/routes.txtAnd:
ss -lntu > baseline/listening-ports.txtYou now have a starting network baseline.
Part 02 — Understand Network Interfaces
Section titled “Part 02 — Understand Network Interfaces”Run:
ip linkYou may see interfaces such as:
lo
eth0
ens33
ens160
enp0s3Interface naming depends on the environment.
Step 03 — Review Interface State
Section titled “Step 03 — Review Interface State”Run:
ip -brief linkLook for states such as:
UP
DOWN
UNKNOWNImportant Concept
Section titled “Important Concept”An interface can exist but still not provide usable network connectivity.
You need to validate:
Interface Exists ↓Interface Enabled ↓Address Assigned ↓Route Available ↓Network ReachablePart 03 — Loopback Interface
Section titled “Part 03 — Loopback Interface”Most Linux systems have:
loThe loopback interface.
Common addresses include:
127.0.0.1for IPv4 and:
::1for IPv6.
Why Loopback Matters
Section titled “Why Loopback Matters”Loopback allows:
Application ↓Local Network Stack ↓Another Local Applicationwithout traffic leaving the host.
Security Significance
Section titled “Security Significance”A service listening only on:
127.0.0.1normally has much less remote exposure than one listening on:
0.0.0.0provided no other forwarding or proxy mechanism exposes it.
Part 04 — Review IP Addresses
Section titled “Part 04 — Review IP Addresses”Run:
ip addrOr use the concise version:
ip -brief addrRecord:
Interface:
IPv4 Address:
IPv4 Prefix:
IPv6 Address:
Interface State:IPv4 Example
Section titled “IPv4 Example”You might see:
192.168.10.25/24This contains:
IP Address192.168.10.25
Prefix/24Part 05 — Understand CIDR
Section titled “Part 05 — Understand CIDR”CIDR expresses the network prefix.
Examples:
| CIDR | Common IPv4 Mask |
|---|---|
/8 |
255.0.0.0 |
/16 |
255.255.0.0 |
/24 |
255.255.255.0 |
/32 |
Single IPv4 host route |
Do not rely only on memorized tables.
Understand that the prefix determines:
Network Portion
Host PortionExample
Section titled “Example”Given:
192.168.10.25/24the network is typically:
192.168.10.0/24and the host address is:
192.168.10.25Part 06 — Public vs Private IPv4
Section titled “Part 06 — Public vs Private IPv4”Common private IPv4 ranges include:
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16These ranges are commonly used inside:
Enterprise Networks
Home Networks
Cloud VPCs/VNets
Lab EnvironmentsSecurity Perspective
Section titled “Security Perspective”Do not assume:
Private IP=SecurePrivate networks can still contain:
Compromised Systems
Malicious Insiders
Misconfigured Services
Lateral MovementPart 07 — Review Routes
Section titled “Part 07 — Review Routes”Run:
ip routeYou may see something conceptually similar to:
default via 192.168.10.1 dev eth0
192.168.10.0/24 dev eth0Routing Model
Section titled “Routing Model”Destination ↓Routing Table ↓Matching Route ↓Gateway / Interface ↓Packet ForwardedStep 04 — Identify the Default Route
Section titled “Step 04 — Identify the Default Route”Look for:
defaultRecord:
Default Gateway:
Interface:Why the Default Gateway Matters
Section titled “Why the Default Gateway Matters”If a destination is outside directly connected networks, Linux usually needs an appropriate route.
A common path is:
Linux Server ↓Default Gateway ↓Other NetworksTroubleshooting Question
Section titled “Troubleshooting Question”If the server can communicate locally but not with remote networks, investigate:
Routing
Gateway
Upstream Firewall
Network ACL
NAT
DestinationPart 08 — Route Selection
Section titled “Part 08 — Route Selection”Linux may have multiple routes.
The system generally selects the most appropriate route based on routing rules and prefix specificity.
Conceptually:
Destination ↓Most Specific Applicable Route ↓Selected PathStep 05 — Ask Linux Which Route It Would Use
Section titled “Step 05 — Ask Linux Which Route It Would Use”For an approved destination:
ip route get <approved-ip>This can show information such as:
Selected Interface
Gateway
Source AddressPart 09 — Review Neighbor Information
Section titled “Part 09 — Review Neighbor Information”On local Ethernet-style networks, systems need to map network-layer addresses to link-layer neighbors.
Run:
ip neighYou may see:
IP Address
MAC Address
Interface
Neighbor StateIPv4 Concept
Section titled “IPv4 Concept”Traditionally:
IPv4 ↓ARP ↓MAC AddressIPv6 Concept
Section titled “IPv6 Concept”IPv6 uses:
Neighbor Discoveryrather than ARP.
Security Perspective
Section titled “Security Perspective”Unexpected neighbor information may sometimes support investigations into:
Address Conflicts
Gateway Problems
Local Network Spoofing
Unexpected Devicesbut evidence must be interpreted carefully.
Part 10 — Test the Local Network Stack
Section titled “Part 10 — Test the Local Network Stack”Test loopback:
ping -c 4 127.0.0.1If IPv6 is available:
ping -c 4 ::1This primarily validates the local IP stack.
Step 06 — Test Your Own Address
Section titled “Step 06 — Test Your Own Address”Identify your assigned address:
ip -brief addrThen test the appropriate local address where useful.
Step 07 — Test the Gateway
Section titled “Step 07 — Test the Gateway”If ICMP is permitted in your lab:
ping -c 4 <gateway-ip>Important
Section titled “Important”A failed ping does not automatically mean:
Gateway Is DownICMP may be filtered.
Use multiple pieces of evidence.
Part 11 — Connectivity Testing Model
Section titled “Part 11 — Connectivity Testing Model”Use this sequence:
01 Loopback
02 Local Interface
03 Local Gateway
04 Remote IP
05 DNS Name
06 Required Port
07 ApplicationThis helps isolate the failing layer.
Part 12 — DNS
Section titled “Part 12 — DNS”DNS translates names into information such as IP addresses.
Conceptually:
application.example ↓ DNS ↓ IP AddressStep 08 — Review Resolver Configuration
Section titled “Step 08 — Review Resolver Configuration”Inspect:
cat /etc/resolv.confDepending on the distribution, this file may be managed dynamically.
You may see:
nameserver
search
optionsImportant
Section titled “Important”Do not assume manually editing /etc/resolv.conf is the correct persistent fix.
It may be managed by:
NetworkManager
systemd-resolved
DHCP
Cloud NetworkingPart 13 — Test DNS
Section titled “Part 13 — Test DNS”Depending on installed utilities, use:
getent hosts example.comor tools such as:
dig
host
nslookupif available.
DNS Troubleshooting Model
Section titled “DNS Troubleshooting Model”Can Reach IP? | +-- No → Network/Routing/Firewall | +-- Yes ↓Can Resolve Name? | +-- No → DNS | +-- Yes ↓Test ApplicationPart 14 — /etc/hosts
Section titled “Part 14 — /etc/hosts”Inspect:
cat /etc/hostsLocal host mappings can influence name resolution.
Security Perspective
Section titled “Security Perspective”Unexpected host-file entries can sometimes:
Redirect Applications
Override Expected Resolution
Cause Troubleshooting ProblemsDo not immediately classify every custom entry as malicious.
Determine its business purpose.
Part 15 — TCP and UDP
Section titled “Part 15 — TCP and UDP”Linux applications commonly communicate using:
TCPor:
UDPTCP provides connection-oriented communication.
Conceptually:
Client ↓Connection Establishment ↓Data Exchange ↓Connection CloseCommon examples include:
SSH
HTTPS
Database ConnectionsUDP is connectionless at the transport layer.
Common uses can include:
DNS
Monitoring
Streaming
Infrastructure Protocolsdepending on the application.
Security Lesson
Section titled “Security Lesson”Do not assume:
UDP=UnimportantUDP services can also create significant attack surface.
Part 16 — Ports
Section titled “Part 16 — Ports”Ports identify application endpoints.
Conceptually:
IP Address +Port +ProtocolExamples commonly include:
22/TCP → SSH
53/UDP → DNS
53/TCP → DNS
80/TCP → HTTP
443/TCP → HTTPSBut never identify a service solely from the port number.
Applications can listen on non-standard ports.
Part 17 — Identify Listening TCP Ports
Section titled “Part 17 — Identify Listening TCP Ports”Run:
ss -lntInterpret:
-lListening
-nNumeric
-tTCPStep 09 — Review UDP Listeners
Section titled “Step 09 — Review UDP Listeners”Run:
ss -lnuStep 10 — Review Processes
Section titled “Step 10 — Review Processes”With appropriate privilege:
sudo ss -lntupThis may help map:
Port ↓Process ↓ServiceNetwork Security Question
Section titled “Network Security Question”For every listener ask:
What Process Owns It?
Which User Runs It?
Why Is It Required?
Which Interface Is It Bound To?
Who Can Reach It?Part 18 — Understand Bind Addresses
Section titled “Part 18 — Understand Bind Addresses”Compare:
127.0.0.1:8080with:
0.0.0.0:8080Conceptually:
127.0.0.1 ↓Local IPv4 Access
0.0.0.0 ↓All Applicable IPv4 InterfacesIPv6 wildcard bindings may appear as:
[::]Actual reachability still depends on:
Routes
Firewall
Network Controls
Application ConfigurationFinding Example
Section titled “Finding Example”Finding:Service Bound to Unnecessary Interfaces
Observation:An application service listens on allavailable interfaces despite only requiringlocal communication.
Risk:The service may become reachable fromnetworks that do not require access.
Recommendation:Bind the service to the minimum requiredinterface and enforce appropriate firewallrestrictions.Part 19 — Established Connections
Section titled “Part 19 — Established Connections”Run:
ss -ntLook for established TCP connections.
For process information:
sudo ss -ntpwhere supported.
Connection Investigation
Section titled “Connection Investigation”For each unexpected connection determine:
Local Address
Local Port
Remote Address
Remote Port
Process
User
Connection StatePart 20 — TCP Connection States
Section titled “Part 20 — TCP Connection States”You may encounter states such as:
LISTEN
ESTAB
TIME-WAIT
SYN-SENT
SYN-RECVThese states help describe where a TCP connection is in its lifecycle.
Security Perspective
Section titled “Security Perspective”For example:
Many SYN-RECV Connectionsmay require investigation.
But do not immediately conclude:
AttackPossible explanations include:
Traffic Spike
Network Problem
Application Behavior
Scanning
Denial-of-Service ActivityContext matters.
Part 21 — Map Process to Port
Section titled “Part 21 — Map Process to Port”Suppose you find:
TCP 8080listening unexpectedly.
Use:
sudo ss -lntpThen identify the process.
You may also use appropriate process inspection tools.
Investigation Workflow
Section titled “Investigation Workflow”PORT ↓PID ↓PROCESS ↓USER ↓EXECUTABLE ↓SERVICE ↓CONFIGURATION ↓BUSINESS REQUIREMENTPart 22 — Review Network Services
Section titled “Part 22 — Review Network Services”List running services:
systemctl --type=service --state=runningCompare:
Running Servicesagainst:
Listening PortsNot every service listens on a network port.
Not every network process is necessarily managed exactly as you expect.
Correlate evidence.
Part 23 — SSH Network Review
Section titled “Part 23 — SSH Network Review”If SSH is running, determine:
Which Port?
Which Address?
Which Process?
Which Interface?
Who Can Reach It?Use:
sudo ss -lntpand the relevant SSH configuration.
Security Model
Section titled “Security Model”Instead of:
SSH Open Everywhereprefer:
Approved Administrators ↓Approved Network ↓Firewall ↓SSHwhere the environment permits.
Part 24 — Host Firewall
Section titled “Part 24 — Host Firewall”Linux host firewalls provide another network-security layer.
Common management technologies include:
firewalld
nftables
ufwYour distribution may use one of these or another approved solution.
Critical Safety Rule
Section titled “Critical Safety Rule”If connected remotely:
DO NOTapply restrictive firewall rulesuntil required administrative accesshas been explicitly allowed.Otherwise you may lock yourself out.
Part 25 — Determine Firewall Technology
Section titled “Part 25 — Determine Firewall Technology”Check which tooling exists and is active.
For firewalld:
systemctl status firewalldFor UFW:
sudo ufw statusFor nftables:
sudo nft list rulesetUse the technology appropriate to your system.
Part 26 — Firewalld Review
Section titled “Part 26 — Firewalld Review”If firewalld is active:
sudo firewall-cmd --get-active-zonesThen:
sudo firewall-cmd --list-allReview:
Zone
Interfaces
Services
Ports
SourcesFirewalld Mental Model
Section titled “Firewalld Mental Model”Interface / Source ↓Zone ↓Policy ↓Allowed TrafficPart 27 — UFW Review
Section titled “Part 27 — UFW Review”If UFW is used:
sudo ufw status verboseReview:
Status
Default Policies
Allowed Services
Source RestrictionsPart 28 — nftables Review
Section titled “Part 28 — nftables Review”If nftables is directly managed:
sudo nft list rulesetYour objective is not to memorize every syntax detail.
Understand:
Table ↓Chain ↓Rule ↓Traffic DecisionPart 29 — Firewall Design
Section titled “Part 29 — Firewall Design”Use:
DEFAULT RESTRICTION ↓EXPLICIT BUSINESS REQUIREMENT ↓ALLOW REQUIRED TRAFFICFor example:
SSH ↓Only Administration Network
HTTPS ↓Approved Client Networks
Database ↓Application Tier OnlyPart 30 — Defense in Depth
Section titled “Part 30 — Defense in Depth”A Linux server may be protected by:
Internet / Enterprise Network ↓Network Firewall ↓Cloud Security Group / NSG ↓Linux Host Firewall ↓Application ListenerDo not rely on only one layer.
Part 31 — Test a TCP Port
Section titled “Part 31 — Test a TCP Port”For an approved destination and port, tools such as:
nc -vz <approved-host> <approved-port>may be available.
If nc is not installed, use another approved connectivity-testing utility appropriate to the application.
Important
Section titled “Important”A successful TCP connection tells you:
Network Path + PortAre ReachableIt does not necessarily prove:
Application Is HealthyPart 32 — Application Testing
Section titled “Part 32 — Application Testing”For HTTP/HTTPS services, an authorized lab may use:
curl -I http://<approved-host>or:
curl -I https://<approved-host>This tests at a higher layer than simple port connectivity.
Troubleshooting Ladder
Section titled “Troubleshooting Ladder”Ping / Reachability ↓Port Connectivity ↓Protocol ↓Application ResponsePart 33 — Trace Network Path
Section titled “Part 33 — Trace Network Path”Where installed and permitted:
traceroute <approved-destination>or equivalent tools may help understand the path.
Remember that network devices may intentionally suppress or filter diagnostic responses.
Part 34 — NetworkManager
Section titled “Part 34 — NetworkManager”Many enterprise Linux distributions use:
NetworkManagerCheck:
systemctl status NetworkManagerIf available:
nmcli device statusStep 11 — Review Connections
Section titled “Step 11 — Review Connections”nmcli connection showUnderstand the distinction between:
Network Deviceand:
Network Connection ProfilePart 35 — Persistent Configuration
Section titled “Part 35 — Persistent Configuration”A critical Linux networking lesson is:
Runtime Change ≠Persistent ChangeA configuration that works now may disappear after:
Reboot
Interface Restart
NetworkManager ReloadAlways understand how your distribution persists network configuration.
Part 36 — DHCP vs Static Addressing
Section titled “Part 36 — DHCP vs Static Addressing”Linux hosts may obtain network configuration through:
DHCPor use:
Static ConfigurationDHCP May Provide
Section titled “DHCP May Provide”IP Address
Subnet
Gateway
DNS
Lease InformationStatic Configuration
Section titled “Static Configuration”May be appropriate when predictable addressing is required.
The correct model depends on infrastructure architecture.
Part 37 — IPv6
Section titled “Part 37 — IPv6”Do not ignore IPv6.
Review:
ip -6 addrThen:
ip -6 routeSecurity Mistake
Section titled “Security Mistake”An organization may carefully restrict:
IPv4while forgetting:
IPv6This can create unexpected exposure.
IPv6 Review Questions
Section titled “IPv6 Review Questions”Is IPv6 Enabled?
Is It Required?
Which Addresses Exist?
Which Services Listen on IPv6?
Does the Firewall Cover IPv6?Part 38 — Network Statistics
Section titled “Part 38 — Network Statistics”Run:
ss -sThis provides a summary of socket usage.
Depending on installed tooling, other system/network statistics may also be available.
Security Perspective
Section titled “Security Perspective”Baselines help you recognize:
Normal Connection Volume
Normal Listening Ports
Normal Destinationsso deviations become easier to investigate.
Part 39 — Network Baseline
Section titled “Part 39 — Network Baseline”Create a baseline containing:
Interfaces
IP Addresses
Routes
Gateway
DNS
Listening Ports
Expected Services
Firewall Rules
Expected External DestinationsExample
Section titled “Example”Linux Network Baseline
Interface:ensX
Role:Application Network
Expected Services:SSHHTTPS
Expected Outbound:DNSPackage RepositoriesLogging Platform
Unexpected Listeners:NonePart 40 — Troubleshooting Scenario 01
Section titled “Part 40 — Troubleshooting Scenario 01”Server Has No Network Connectivity
Section titled “Server Has No Network Connectivity”Use:
Interface ↓Link State ↓IP Address ↓Subnet ↓Route ↓Gateway ↓FirewallCommands may include:
ip -brief linkip -brief addrip routeip neighPart 41 — Troubleshooting Scenario 02
Section titled “Part 41 — Troubleshooting Scenario 02”Server Can Reach IPs but Not Names
Section titled “Server Can Reach IPs but Not Names”Likely investigation path:
Network Works ↓Routing Works ↓DNS FailsCheck:
Resolver Configuration
DNS Server Reachability
Name Resolution
Local Hosts FilePart 42 — Troubleshooting Scenario 03
Section titled “Part 42 — Troubleshooting Scenario 03”Service Works Locally but Not Remotely
Section titled “Service Works Locally but Not Remotely”Investigate:
Application Running? ↓Listening? ↓Correct Bind Address? ↓Host Firewall? ↓Network Firewall? ↓Routing? ↓Client Path?A common cause is:
Service Bound Onlyto Loopbackbut many other causes are possible.
Part 43 — Troubleshooting Scenario 04
Section titled “Part 43 — Troubleshooting Scenario 04”Server Can Reach Local Network but Not Internet
Section titled “Server Can Reach Local Network but Not Internet”Investigate:
Default Route
Gateway
Upstream Routing
NAT
Firewall
DNSTest IP connectivity separately from DNS.
Part 44 — Troubleshooting Scenario 05
Section titled “Part 44 — Troubleshooting Scenario 05”Connection Refused
Section titled “Connection Refused”Conceptually:
Network Path Reaches Host ↓Target Port Rejects ConnectionPossible causes:
Service Not Running
Wrong Port
Application Not Listening
Local PolicyPart 45 — Troubleshooting Scenario 06
Section titled “Part 45 — Troubleshooting Scenario 06”Connection Times Out
Section titled “Connection Times Out”Possible causes include:
Routing Failure
Firewall Drop
Network ACL
Unreachable Host
Application Path ProblemDo not treat:
Timeoutand:
Connection Refusedas identical symptoms.
Part 46 — Troubleshooting Scenario 07
Section titled “Part 46 — Troubleshooting Scenario 07”Wrong IP Address
Section titled “Wrong IP Address”Check:
ip addrThen determine:
DHCP?
Static?
Wrong Profile?
Wrong Interface?
Cloud Configuration?Part 47 — Troubleshooting Scenario 08
Section titled “Part 47 — Troubleshooting Scenario 08”Duplicate IP
Section titled “Duplicate IP”Possible symptoms include:
Intermittent Connectivity
Unexpected Neighbor Changes
Connection InstabilityInvestigate:
Address Assignment
DHCP
Neighbor Table
Network InfrastructurePart 48 — Troubleshooting Scenario 09
Section titled “Part 48 — Troubleshooting Scenario 09”Application Cannot Reach Database
Section titled “Application Cannot Reach Database”Use:
Application Host ↓DNS ↓Route ↓Firewall ↓Database Listener ↓Application AuthenticationDo not assume every database connection problem is:
NetworkIt may be:
Authentication
TLS
Application Configuration
Database PolicyPart 49 — Troubleshooting Scenario 10
Section titled “Part 49 — Troubleshooting Scenario 10”SSH Cannot Connect
Section titled “SSH Cannot Connect”Review:
Client Network
DNS / IP
Route
Firewall
Port
sshd Listener
SSH Service
Authentication
Account PolicyThis is a layered problem.
Part 50 — Network Security Investigation
Section titled “Part 50 — Network Security Investigation”Suppose your monitoring platform reports:
Linux ServerConnecting toUnexpected External IPDo not immediately block it without understanding the context.
Investigate:
Remote IP ↓Connection ↓Local Process ↓PID ↓User ↓Executable ↓Parent Process ↓Business RequirementStep 12 — Review Active Connections
Section titled “Step 12 — Review Active Connections”Use:
sudo ss -ntpIdentify:
Remote Address
Local Process
PIDStep 13 — Investigate Process
Section titled “Step 13 — Investigate Process”For an authorized process:
ps -fp <PID>Review:
User
Parent
Command
Start InformationAdditional process inspection may be appropriate depending on the investigation.
Security Investigation Model
Section titled “Security Investigation Model”NETWORK ↓PROCESS ↓USER ↓FILE ↓PARENT ↓TIMELINE ↓BUSINESS CONTEXTPart 51 — Unexpected Listening Port
Section titled “Part 51 — Unexpected Listening Port”Suppose you discover:
0.0.0.0:9000and it is not in the approved baseline.
Investigate:
01 Identify Process
02 Identify User
03 Identify Executable
04 Identify Service
05 Review Start Method
06 Review Logs
07 Confirm Business Requirement
08 Determine Exposure
09 Assess Risk
10 Remediate if AuthorizedFinding Example
Section titled “Finding Example”Finding:Unexpected Network Listener
Observation:A service is listening on TCP port 9000across available network interfaces butis not present in the approved serverbaseline.
Risk:The service may create unnecessarynetwork attack surface or represent anunauthorized application.
Recommendation:Identify the process owner and businessrequirement. Remove or restrict theservice if it is not authorized.Part 52 — Unexpected Outbound Connection
Section titled “Part 52 — Unexpected Outbound Connection”Finding:Unexpected Outbound Network Connection
Observation:A server process established a connectionto an external destination that is notpart of the documented application flow.
Risk:Unexpected outbound communication mayrepresent misconfiguration, unauthorizedsoftware, or potentially maliciousactivity.
Recommendation:Correlate the connection with the process,user, executable, logs, destinationreputation, and business requirementsbefore determining the appropriatecontainment or remediation action.Part 53 — Overly Broad Firewall Rule
Section titled “Part 53 — Overly Broad Firewall Rule”Finding:Overly Broad Network Access
Observation:A network service is permitted from abroader source range than required forits business function.
Risk:Unnecessary network reachability increasesthe number of systems capable ofinteracting with the service.
Recommendation:Restrict access to approved sourcenetworks or systems using least-privilegefirewall rules.Part 54 — Administrative Service Exposure
Section titled “Part 54 — Administrative Service Exposure”Finding:Administrative Service Broadly Exposed
Observation:A remote administration service isreachable from networks that do notrequire administrative access.
Risk:Broader administrative exposure increasesthe opportunity for authentication attacksand exploitation of the service.
Recommendation:Restrict administrative access toapproved management networks and enforcestrong authentication and monitoring.Part 55 — Missing Host Firewall
Section titled “Part 55 — Missing Host Firewall”Finding:Host-Level Network Filtering Not Enforced
Observation:The Linux server does not have an activehost-level network-filtering policy,despite the server role requiringdefense-in-depth controls.
Risk:The server relies entirely on upstreamnetwork controls and may become exposedif those controls are changed or bypassed.
Recommendation:Implement an approved host firewall policythat permits required traffic and restrictsunnecessary access.Part 56 — Network Logging
Section titled “Part 56 — Network Logging”Network security requires visibility.
Relevant evidence can come from:
Application Logs
SSH Logs
Firewall Logs
System Journal
DNS Logs
Proxy Logs
Cloud Flow Logs
Network Security Devices
SIEMLinux Perspective
Section titled “Linux Perspective”Linux tells you:
Which Process
Which User
Which SocketNetwork infrastructure may tell you:
Which Source
Which Destination
Which FlowCombining both provides stronger evidence.
Part 57 — Cloud Networking Connection
Section titled “Part 57 — Cloud Networking Connection”Linux networking directly maps to cloud networking.
Linux Interface ↓EC2 ENI ↓Subnet ↓Route Table ↓Security Group ↓NACL ↓GatewayLinux Interface ↓Azure NIC ↓Subnet ↓Route ↓NSG ↓Azure NetworkGoogle Cloud
Section titled “Google Cloud”Linux Interface ↓Compute Interface ↓VPC ↓Subnet ↓Route ↓Firewall PolicyCritical Cloud Lesson
Section titled “Critical Cloud Lesson”A Linux administrator may see:
Everything Looks Correctinside the VM.
But the failure may exist in:
Cloud Route
Security Group
NSG
VPC Firewall
Network ACL
Load Balancer
NATAlways understand both layers.
Part 58 — Container Networking Connection
Section titled “Part 58 — Container Networking Connection”Containers introduce another networking layer.
Physical / Cloud Network ↓Linux Host ↓Container Network ↓Container ↓ApplicationLinux networking knowledge helps you understand:
Container Interfaces
Bridges
NAT
Port Publishing
NamespacesPart 59 — Kubernetes Networking Connection
Section titled “Part 59 — Kubernetes Networking Connection”Kubernetes expands this further:
External Client ↓Load Balancer / Ingress ↓Service ↓Pod Network ↓Container ↓Linux Network StackThis is why Linux networking is foundational for:
Kubernetes SecurityPart 60 — SOC Connection
Section titled “Part 60 — SOC Connection”Linux network evidence helps investigate alerts such as:
Unexpected Outbound Connection
New Listening Port
SSH Connection
Suspicious DNS Request
Port Scan
Command-and-Control Indicator
Lateral MovementSOC Workflow
Section titled “SOC Workflow”ALERT ↓IP / PORT ↓LINUX HOST ↓PROCESS ↓USER ↓TIMELINE ↓DECISIONPart 61 — Incident Response Connection
Section titled “Part 61 — Incident Response Connection”During an incident, network information can help determine:
Which Systems Communicated?
Which Process Connected?
Which Accounts Were Involved?
Which Destinations Were Contacted?
Which Services Were Exposed?Do not destroy evidence unnecessarily by immediately:
Restarting
Killing Processes
Clearing Connections
Reconfiguring Everythingbefore collecting required evidence.
Part 62 — Build a Network Inventory
Section titled “Part 62 — Build a Network Inventory”Create:
Linux Network InventoryInclude:
Hostname:
Interfaces:
MAC Addresses:
IPv4 Addresses:
IPv6 Addresses:
Subnets:
Default Gateway:
DNS Servers:
Listening TCP Ports:
Listening UDP Ports:
Firewall Technology:
Expected Services:Part 63 — Build a Service Exposure Matrix
Section titled “Part 63 — Build a Service Exposure Matrix”| Service | Protocol | Port | Bind Address | Required | Expected Sources |
|---|---|---|---|---|---|
| SSH | TCP | 22 | Review | Yes | Admin Network |
| HTTPS | TCP | 443 | Review | If applicable | Approved Clients |
| Unknown | TCP | Example | Review | Review | Review |
Part 64 — Build a Connectivity Matrix
Section titled “Part 64 — Build a Connectivity Matrix”| Source | Destination | Port | Expected | Result |
|---|---|---|---|---|
| Admin Host | Linux Server | SSH | Yes | Test |
| Linux Server | DNS | DNS | Yes | Test |
| Linux Server | Approved App | App Port | Yes | Test |
| Unapproved Source | Admin Service | SSH | No | Validate restriction |
Only perform tests inside your authorized environment.
Part 65 — Create the Networking Report
Section titled “Part 65 — Create the Networking Report”Your report should contain:
1. Executive Summary
Section titled “1. Executive Summary”Describe:
Overall Network State
Major Connectivity Issues
Unexpected Exposure
Firewall Status
Highest-Risk Findings2. System Information
Section titled “2. System Information”Hostname
Distribution
Kernel
Server Role3. Interface Inventory
Section titled “3. Interface Inventory”Interface
State
MAC
IPv4
IPv64. Routing
Section titled “4. Routing”Connected Routes
Default Gateway
Unexpected Routes5. DNS
Section titled “5. DNS”Resolver Configuration
Resolution Test
Observed Issues6. Services
Section titled “6. Services”Listening Port
Protocol
Process
User
Bind Address
Business Requirement7. Firewall
Section titled “7. Firewall”Technology
State
Allowed Traffic
Observed Gaps8. Active Connections
Section titled “8. Active Connections”Document relevant:
Local Endpoint
Remote Endpoint
Process
User
Expected?9. Findings
Section titled “9. Findings”For each:
Title
Observation
Risk
Evidence
Recommendation
PriorityPart 66 — Evidence Checklist
Section titled “Part 66 — Evidence Checklist”Capture appropriate evidence for:
- Hostname
- Distribution
- Network interfaces
- MAC addresses
- IPv4 addresses
- IPv6 addresses
- Routes
- Default gateway
- Neighbor table
- DNS configuration
- DNS resolution
- Listening TCP ports
- Listening UDP ports
- Active connections
- Process-to-port mappings
- Firewall state
- Firewall rules
- Expected services
- Unexpected exposure
- Security findings
Do not unnecessarily capture:
Credentials
Private Keys
Tokens
Sensitive Application DataPart 67 — Practical Challenge
Section titled “Part 67 — Practical Challenge”Without using a graphical interface, answer:
What Is My IP?
What Is My Prefix?
What Is My Gateway?
Which Interface Carries Default Traffic?
Which DNS Resolver Is Used?
Which TCP Ports Are Listening?
Which UDP Ports Are Listening?
Which Processes Own Them?
Which Connections Are Established?
Which Firewall Is Active?Part 68 — Troubleshooting Challenge
Section titled “Part 68 — Troubleshooting Challenge”Your Linux server:
Can Reach 8.8.8.8but:
Cannot Resolve example.comWhich layer should you investigate first?
DNSbecause basic IP connectivity already works.
Part 69 — Troubleshooting Challenge
Section titled “Part 69 — Troubleshooting Challenge”Your application responds on:
127.0.0.1:8080but remote clients cannot connect.
Investigate:
Bind Address
Host Firewall
Upstream Firewall
RoutingThe service may be intentionally restricted to loopback.
Part 70 — Troubleshooting Challenge
Section titled “Part 70 — Troubleshooting Challenge”A port is permitted by the firewall, but:
Connection RefusedWhat should you investigate?
Is the Application Running?
Is It Listening?
Is It Listening on the Correct Address?
Is the Correct Port Configured?A firewall rule cannot create a listener.
Part 71 — Troubleshooting Challenge
Section titled “Part 71 — Troubleshooting Challenge”The service is listening and the Linux firewall permits it, but clients still time out.
Move outward:
Linux Host ↓Cloud / Network Firewall ↓Route ↓Load Balancer ↓Client NetworkPart 72 — Security Challenge
Section titled “Part 72 — Security Challenge”You discover:
Unknown Process ↓Listening on 0.0.0.0:4444Do not immediately classify it solely by the port number.
Investigate:
PID
Process
Executable
User
Parent
Start Time
Service
Logs
Network Connections
Business RequirementPort numbers alone are not proof of malicious behavior.
Part 73 — Network Troubleshooting Method
Section titled “Part 73 — Network Troubleshooting Method”Use this professional workflow:
01 Understand the Symptom
02 Determine Scope
03 Identify Source
04 Identify Destination
05 Identify Protocol and Port
06 Check Interface
07 Check Address
08 Check Route
09 Check DNS
10 Check Listener
11 Check Firewall
12 Check Application
13 Review Logs
14 Compare Baseline
15 Fix Minimum Necessary Layer
16 Validate
17 DocumentPart 74 — Common Networking Mistakes
Section titled “Part 74 — Common Networking Mistakes”Avoid:
Restarting Network Services Immediately
Disabling Firewall to Troubleshoot
Assuming Ping Proves Everything
Assuming Ping Failure Means Host Down
Ignoring DNS
Ignoring IPv6
Ignoring Bind Addresses
Assuming Port Number Identifies Application
Making Temporary Changes Permanent Accidentally
Forgetting Cloud Network Controls
Opening 0.0.0.0/0 Without Requirement
Failing to Document Routes
Ignoring Outbound ConnectionsPart 75 — Security Design Principles
Section titled “Part 75 — Security Design Principles”Apply:
Least Exposure
Network Segmentation
Defense in Depth
Explicit Business Requirements
Secure Administration
Logging
Monitoring
Controlled Egress
Baseline ComparisonPart 76 — Network Segmentation
Section titled “Part 76 — Network Segmentation”Instead of:
Every ServerCan ReachEvery Serverprefer architectures such as:
User Tier ↓Application Tier ↓Database Tierwith controlled communication between layers.
Security Benefit
Section titled “Security Benefit”Segmentation can reduce:
Attack Surface
Lateral Movement
Blast RadiusPart 77 — Ingress vs Egress
Section titled “Part 77 — Ingress vs Egress”Ingress
Section titled “Ingress”Traffic entering the server:
Client ↓Linux ServerEgress
Section titled “Egress”Traffic leaving the server:
Linux Server ↓External DestinationSecurity teams should consider both.
Why Egress Matters
Section titled “Why Egress Matters”If malware executes on a server, unrestricted outbound access may allow:
Command and Control
Data Exfiltration
Malicious DownloadsTherefore outbound communication should also have business context.
Part 78 — Network Baseline Maturity
Section titled “Part 78 — Network Baseline Maturity”Level 1
Section titled “Level 1”Know IP Addresses
Know Gateway
Know Listening PortsLevel 2
Section titled “Level 2”Document Required Services
Apply Host Firewall
Monitor Connections
Centralize LogsLevel 3
Section titled “Level 3”Network Segmentation
Controlled Egress
Flow Monitoring
Automated Baselines
Configuration ManagementLevel 4
Section titled “Level 4”Continuous Network Detection
Automated Drift Detection
Zero Trust Access
Policy as CodePart 79 — Career Connection
Section titled “Part 79 — Career Connection”This lab directly supports:
Linux Administrator
Network Administrator
SOC Analyst
Security Engineer
Cloud Engineer
Cloud Security Engineer
DevOps Engineer
DevSecOps Engineer
Incident Responder
Penetration TesterInterview Scenario 01
Section titled “Interview Scenario 01”A Linux server can communicate with local systems but not remote networks. What do you check?
Routes
Default Gateway
Upstream Routing
Firewall
NATInterview Scenario 02
Section titled “Interview Scenario 02”A server can reach an IP address but cannot reach the hostname. What is likely wrong?
Start with:
DNS ResolutionInterview Scenario 03
Section titled “Interview Scenario 03”An application works locally but remote users cannot reach it. What do you investigate?
Bind Address
Listening Port
Host Firewall
Network Firewall
Route
Application ConfigurationInterview Scenario 04
Section titled “Interview Scenario 04”How do you identify which process owns a listening port?
A common approach is:
sudo ss -lntupand then correlate the PID/process with system information.
Interview Scenario 05
Section titled “Interview Scenario 05”Why should you review outbound connections?
Because unexpected outbound communication may indicate:
Misconfiguration
Unauthorized Software
Compromise
Data Exfiltration
Command-and-Control Activity50 Linux Networking Interview Questions
Section titled “50 Linux Networking Interview Questions”- What is a network interface?
- What is the loopback interface?
- What is
127.0.0.1? - What is an IP address?
- What is CIDR?
- What does
/24mean? - What are private IPv4 ranges?
- What is a subnet?
- What is a default gateway?
- What does
ip routeshow? - How does Linux select a route?
- What does
ip route getdo? - What is ARP?
- What is IPv6 Neighbor Discovery?
- What does
ip neighshow? - What is DNS?
- What is
/etc/resolv.conf? - Why should you not always edit
/etc/resolv.confdirectly? - What is
/etc/hosts? - What is TCP?
- What is UDP?
- What is a network port?
- What is a listening port?
- What is an established connection?
- What does
ssdo? - How do you identify listening TCP ports?
- How do you identify UDP listeners?
- How do you map a port to a process?
- What does
0.0.0.0mean for a listener? - What does
127.0.0.1mean for a listener? - What is the difference between connection refused and timeout?
- Why might ping fail even if a service is reachable?
- What is a host firewall?
- What is firewalld?
- What is nftables?
- What is UFW?
- What is ingress traffic?
- What is egress traffic?
- Why should outbound traffic be monitored?
- What is network segmentation?
- Why is IPv6 security important?
- What is NetworkManager?
- What does
nmclimanage? - What is the difference between DHCP and static addressing?
- How would you troubleshoot DNS failure?
- How would you troubleshoot SSH connectivity?
- How would you investigate an unknown listening port?
- How would you investigate an unexpected outbound connection?
- How does Linux networking relate to cloud networking?
- Why is a network baseline valuable for incident response?
Lab Completion Checklist
Section titled “Lab Completion Checklist”Interfaces
Section titled “Interfaces”- Identified interfaces
- Reviewed interface state
- Identified loopback
- Reviewed MAC information
- Reviewed IPv4
- Reviewed IPv6
Addressing
Section titled “Addressing”- Understood CIDR
- Identified subnet
- Identified private/public addressing concepts
- Reviewed address configuration
Routing
Section titled “Routing”- Reviewed routing table
- Identified default route
- Identified gateway
- Tested route selection
- Reviewed neighbor information
- Reviewed resolver configuration
- Tested name resolution
- Reviewed
/etc/hosts - Understood DNS troubleshooting
Transport
Section titled “Transport”- Understood TCP
- Understood UDP
- Reviewed TCP listeners
- Reviewed UDP listeners
- Reviewed connection states
Services
Section titled “Services”- Mapped ports to processes
- Identified service owners
- Reviewed bind addresses
- Validated business requirements
Firewall
Section titled “Firewall”- Identified firewall technology
- Reviewed firewall status
- Reviewed allowed services/ports
- Understood least-exposure design
- Preserved administrative access
Troubleshooting
Section titled “Troubleshooting”- Tested loopback
- Tested local network
- Tested gateway
- Tested DNS
- Tested port connectivity
- Tested application layer
- Practiced layered troubleshooting
Security
Section titled “Security”- Reviewed unexpected listeners
- Reviewed active connections
- Reviewed administrative exposure
- Reviewed outbound communication
- Documented security findings
Documentation
Section titled “Documentation”- Created interface inventory
- Created route inventory
- Created port inventory
- Created service exposure matrix
- Created connectivity matrix
- Created network assessment report
Final Linux Networking Mental Model
Section titled “Final Linux Networking Mental Model”When investigating Linux networking, think:
WHOWhich process/user?
WHATWhich application/protocol?
WHEREWhich local and remote address?
PORTWhich service endpoint?
INTERFACEWhich network interface?
ROUTEWhich path?
DNSWhich name resolution?
FIREWALLWhich traffic is permitted?
LOGSWhat evidence exists?
BASELINEIs this expected?Mission Accomplished
Section titled “Mission Accomplished”You have now worked through:
Linux Interfaces
IPv4
IPv6
CIDR
Routing
Gateways
Neighbors
DNS
TCP
UDP
Ports
Sockets
Processes
Services
Firewall Controls
Network Troubleshooting
Network Security AnalysisYou have moved from:
Linux Userto thinking like:
Linux Network Administrator+Security AnalystMost importantly, you now have a repeatable troubleshooting workflow:
INTERFACE ↓IP ADDRESS ↓SUBNET ↓ROUTE ↓GATEWAY ↓DNS ↓PORT ↓FIREWALL ↓APPLICATIONWhat’s Next?
Section titled “What’s Next?”➡️ Lab 05 — Linux Security
In the final Linux lab, you will combine the skills from:
Linux Administration
Linux Hardening
Linux IAM
Linux Networkinginto a complete Linux security assessment.
You will work through:
System Baseline ↓Identity Review ↓Privilege Review ↓Filesystem Security ↓Process Investigation ↓Service Security ↓Network Exposure ↓Logging and Auditing ↓Persistence Review ↓Security Controls ↓Suspicious Activity Investigation ↓Findings and RemediationYour Linux lab journey continues:
Lab 01 — Linux Administration ↓Lab 02 — Linux Hardening ↓Lab 03 — Linux IAM ↓Lab 04 — Linux Networking ↓Lab 05 — Linux Security ↓Runbook 01 — Linux Incident Investigation ↓Runbook 02 — Linux Security Assessment ↓Runbook 03 — Linux Server Hardening