The Interview Question That Exposes Your Networking Gaps
You're in a Security Engineering interview. The interviewer shows you this diagram:
ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Developer β β Office NAT β β Router β β File Serverβ
β ββββββββββΊβ ββββββββββΊβ ββββββββββΊβ β
β192.168.1.50β β WAN: 198.51.100.10 β β β 20.0.0.100 β
ββββββββββββββ β LAN: 192.168.1.1 β 198.51.100.254 ββββββββββββββ
ββββββββββββββ ββββββββββββββ
Then they ask:
"The File Server has this iptables rule, but the Developer can't SSH in. Why?"
iptables -A INPUT -s 192.168.1.50 --dport 22 -j ACCEPT
Can you answer this in 10 seconds?
If not, this article is for you. I've compiled 12 packet tracing problems that will permanently fix this gap in your knowledge.
β Free Practice Problems on GitHub
I'm building an open-source collection of Security Engineering interview prep materials. If you find this useful:
Your stars help other security engineers discover these resources!
The Core Insight
Most candidates fail this question because they don't understand one fundamental rule:
| Device Type | Changes Source/Dest IP? |
|---|---|
| NAT | β Yes |
| Router | β No |
| Firewall | β No (filtering only) |
The File Server sees 198.51.100.10 (the NAT's public IP), not 192.168.1.50 (the Developer's private IP).
The fix:
iptables -A INPUT -s 198.51.100.10 --dport 22 -j ACCEPT
This pattern appears in technical assessments at top security companies. Let's master it.
π― 12 Packet Tracing Problems
These problems are modeled after real technical assessments used by top security teams.
Instructions:
- Time yourself: 30 minutes
- Passing score: 85%
- Answer key is at the bottom β no peeking!
Section A: Outbound NAT (SNAT/MASQUERADE)
Problem 1: Basic NAT
ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Client β β NAT Router β β Web Server β
β ββββββββββΊβ ββββββββββΊβ β
β 10.0.0.50 β β WAN: 203.0.113.5 β 93.184.216.34
ββββββββββββββ β LAN: 10.0.0.1β ββββββββββββββ
ββββββββββββββ
Client sends HTTP request to Web Server.
At Point A (Client β NAT Router):
- Source IP: __________
- Destination IP: __________
At Point B (NAT Router β Web Server):
- Source IP: __________
- Destination IP: __________
Problem 2: NAT + Router Chain
ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Workstationβ β NAT Router β β Router β β Server β
β ββββββββββΊβ ββββββββββΊβ ββββββββββΊβ β
β192.168.1.100 β WAN: 74.125.1.1 β β β 8.8.8.8 β
ββββββββββββββ β LAN: 192.168.1.1 β 74.125.1.254 ββββββββββββββ
ββββββββββββββ ββββββββββββββ
Workstation sends DNS query to 8.8.8.8.
At Point A (Workstation β NAT Router):
- Source IP: __________
- Destination IP: __________
At Point B (NAT Router β Router):
- Source IP: __________
- Destination IP: __________
At Point C (Router β Server):
- Source IP: __________
- Destination IP: __________
Problem 3: Double NAT (Carrier-Grade NAT)
ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Laptop β β Home NAT β β ISP NAT β β Server β
β ββββββββββΊβ ββββββββββΊβ (CGNAT) ββββββββββΊβ β
β192.168.0.25β β WAN: 100.64.1.50 β WAN: 52.1.2.3 β 151.101.1.69
ββββββββββββββ β LAN: 192.168.0.1 β LAN: 100.64.0.1 ββββββββββββββ
ββββββββββββββ ββββββββββββββ
Laptop connects to Server (Double NAT scenario).
At Point A (Laptop β Home NAT):
- Source IP: __________
- Destination IP: __________
At Point B (Home NAT β ISP NAT):
- Source IP: __________
- Destination IP: __________
At Point C (ISP NAT β Server):
- Source IP: __________
- Destination IP: __________
What source IP does the Server see? __________
Section B: Inbound NAT (DNAT / Port Forwarding)
Problem 4: Basic DNAT
ββββββββββββββ
β NAT Router β
ββββββββββββββ β β ββββββββββββββ
β Internet ββββββββββΊβ WAN: 203.0.113.10 β Web Server β
β Client β β LAN: 10.0.0.1βββββββΊβ β
β 72.45.67.89β β β β 10.0.0.100 β
ββββββββββββββ β DNAT: β ββββββββββββββ
β 80β10.0.0.100:80
ββββββββββββββ
Internet Client connects to http://203.0.113.10 (port 80).
At Point A (Client β NAT Router WAN):
- Source IP: __________
- Destination IP: __________
At Point B (NAT Router β Web Server):
- Source IP: __________
- Destination IP: __________
What source IP does the Web Server see? __________
Problem 5: DNAT Through Router (Security Scenario)
ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Attacker β β Router β β Firewall β β SSH Server β
β ββββββββββΊβ ββββββββββΊβ (NAT) ββββββββββΊβ β
β 45.33.32.1 β β β β WAN: 104.44.1.1 β 10.0.0.50 β
ββββββββββββββ β 45.33.32.254 β DNAT: 22β10.0.0.50:22β β
ββββββββββββββ ββββββββββββββ ββββββββββββββ
Attacker attempts SSH to 104.44.1.1.
At Point A (Attacker β Router):
- Source IP: __________
- Destination IP: __________
At Point B (Router β Firewall):
- Source IP: __________
- Destination IP: __________
At Point C (Firewall β SSH Server):
- Source IP: __________
- Destination IP: __________
The SSH Server has this firewall rule:
iptables -A INPUT -s 45.33.32.254 --dport 22 -j DROP
Will this block the attacker? __________
Why? __________
Section C: Firewall Troubleshooting
Problem 6: The Classic NAT Trap
ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Developer β β Office NAT β β Router β β File Serverβ
β ββββββββββΊβ ββββββββββΊβ ββββββββββΊβ β
β192.168.1.50β β WAN: 198.51.100.10 β β β 20.0.0.100 β
ββββββββββββββ β LAN: 192.168.1.1 β 198.51.100.254 ββββββββββββββ
ββββββββββββββ ββββββββββββββ
File Server has this iptables rule:
iptables -A INPUT -s 192.168.1.50 --dport 22 -j ACCEPT
Will the Developer be able to SSH to the File Server? __________
What source IP does the File Server actually see? __________
Write the corrected iptables rule: __________
Problem 7: VPN Without NAT
ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Admin β β VPN GW β β Server β
β βββββββββββ€ ββββββββββΊβ β
β 10.8.0.50 β VPN β 10.8.0.1 β β 172.16.0.10β
β(VPN tunnel)β β 172.16.0.1 β β β
ββββββββββββββ ββββββββββββββ ββββββββββββββ
Note: VPN Gateway does NOT NAT internal traffic.
Admin SSHs to Server (172.16.0.10).
What source IP does the Server see? __________
Server has firewall rule:
iptables -A INPUT -s 10.8.0.0/24 --dport 22 -j ACCEPT
Will Admin be allowed to SSH? __________
Problem 8: Same Private IP, Different Offices
ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Seattle β β Seattle β β β β β
β Developer ββββββββββΊβ NAT Router ββββββββββΊβ Internet ββββββββββΊβ Cloud LB β
β192.168.1.75β β WAN: 52.12.1.1 β β β 35.200.1.1 β
ββββββββββββββ ββββββββββββββ β β βββββββ¬βββββββ
β β β
ββββββββββββββ ββββββββββββββ β β βββββββΌβββββββ
β Austin β β Austin β β β β Backend β
β Developer ββββββββββΊβ NAT Router ββββββββββΊβ β β Server β
β192.168.1.75β β WAN: 104.210.1.1 β β β 10.0.0.50 β
ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ
Note: Both developers have the SAME private IP (192.168.1.75) - different offices.
Cloud Load Balancer DNATs to Backend Server.
Backend Server has this firewall rule:
iptables -A INPUT -s 192.168.1.75 --dport 443 -j ACCEPT
Will Seattle Developer connect? __________
Will Austin Developer connect? __________
What two source IPs does Backend Server actually see?
- Seattle: __________
- Austin: __________
Write corrected firewall rules to allow both offices: __________
Problem 9: IP Allowlisting
ββββββββββββββ ββββββββββββββ ββββββββββββββ
β App Server β β NAT Gatewayβ β External β
β ββββββββββΊβ ββββββββββΊβ API β
β 10.0.2.50 β β priv: 10.0.2.1 β 151.101.1.1β
ββββββββββββββ β pub: 54.23.45.67 ββββββββββββββ
ββββββββββββββ
App Server makes HTTPS request to External API.
What source IP does External API see? __________
External API has allowlist:
Allowed IPs: 54.23.45.67, 54.23.45.68
Will the request succeed? __________
Problem 10: Blocking a Scanner (The Trap)
ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Malicious β β Router β β Firewall β β Web Server β
β Scanner ββββββββββΊβ (no NAT)ββββββββββΊβ (NAT) ββββββββββΊβ β
β 45.33.32.1 β β β β WAN: 104.44.1.1 β 10.0.0.80 β
ββββββββββββββ β 45.33.32.254 β DNAT: 443β10.0.0.80 β β
ββββββββββββββ ββββββββββββββ ββββββββββββββ
Web Server has this firewall rule to block the scanner:
iptables -A INPUT -s 45.33.32.254 -j DROP
Will this rule block the scanner? __________
What source IP does the Web Server see? __________
Write the corrected blocking rule: __________
Section D: Return Traffic
Problem 11: Outbound Return Path
ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Client β β NAT Router β β Server β
β βββββββββββ€ βββββββββββ€ β
β 10.0.0.50 β β WAN: 203.0.113.5 β 93.184.216.34
ββββββββββββββ β LAN: 10.0.0.1β ββββββββββββββ
ββββββββββββββ
Server sends HTTP response back to Client.
At Point A (Server β NAT Router):
- Source IP: __________
- Destination IP: __________
At Point B (NAT Router β Client):
- Source IP: __________
- Destination IP: __________
What changes the destination IP from 203.0.113.5 to 10.0.0.50? __________
Problem 12: DNAT Return Path
ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Internet β β Firewall β β Web Server β
β Client βββββββββββ€ (NAT) βββββββββββ€ β
β 72.45.67.89β β DNAT: 80β10.0.0.100 β 10.0.0.100 β
ββββββββββββββ β WAN: 203.0.113.10 ββββββββββββββ
ββββββββββββββ
Web Server sends HTTP response back to Internet Client.
At Point A (Web Server β Firewall):
- Source IP: __________
- Destination IP: __________
At Point B (Firewall β Internet Client):
- Source IP: __________
- Destination IP: __________
β Found This Useful?
I'm building an open-source Security Engineering interview prep repository with:
- π₯ More packet tracing problems
- π₯ iptables scenario labs
- π₯ SQL injection practice
- π₯ Threat modeling exercises
- π₯ System design questions
Star the repo on GitHub to support the project and get notified of new content!
Answer Key
Section A: Outbound NAT
Problem 1
- Point A: SRC=10.0.0.50, DST=93.184.216.34
- Point B: SRC=203.0.113.5, DST=93.184.216.34
Key insight: NAT changes the source IP. Destination stays the same.
Problem 2
- Point A: SRC=192.168.1.100, DST=8.8.8.8
- Point B: SRC=74.125.1.1, DST=8.8.8.8
- Point C: SRC=74.125.1.1, DST=8.8.8.8
Key insight: The Router doesn't change the source IPβonly NAT does.
Problem 3
- Point A: SRC=192.168.0.25, DST=151.101.1.69
- Point B: SRC=100.64.1.50, DST=151.101.1.69
- Point C: SRC=52.1.2.3, DST=151.101.1.69
- Server sees: 52.1.2.3
Key insight: Each NAT changes the source IP. Two NATs = two translations.
Section B: Inbound NAT
Problem 4
- Point A: SRC=72.45.67.89, DST=203.0.113.10
- Point B: SRC=72.45.67.89, DST=10.0.0.100
- Web Server sees: 72.45.67.89
Key insight: DNAT changes the destination, not the source. The client's real IP survives.
Problem 5
- Point A: SRC=45.33.32.1, DST=104.44.1.1
- Point B: SRC=45.33.32.1, DST=104.44.1.1
- Point C: SRC=45.33.32.1, DST=10.0.0.50
- Will it block? NO
- Why? The rule blocks 45.33.32.254 (the router), but the attacker's real IP is 45.33.32.1. Routers don't change source IPs.
Correct rule:
iptables -A INPUT -s 45.33.32.1 --dport 22 -j DROP
Section C: Firewall Troubleshooting
Problem 6
- Will Developer SSH? NO
- File Server sees: 198.51.100.10
- Corrected rule:
iptables -A INPUT -s 198.51.100.10 --dport 22 -j ACCEPT
This is the #1 interview question pattern. Private IPs don't survive NAT.
Problem 7
- Server sees: 10.8.0.50
- Will Admin SSH? YES (10.8.0.50 is within 10.8.0.0/24)
Key insight: Without NAT, the original source IP is preserved.
Problem 8
- Seattle connect? NO
- Austin connect? NO
-
Backend Server sees:
- Seattle: 52.12.1.1
- Austin: 104.210.1.1
- Corrected rules:
iptables -A INPUT -s 52.12.1.1 --dport 443 -j ACCEPT
iptables -A INPUT -s 104.210.1.1 --dport 443 -j ACCEPT
Key insight: Same private IP in different offices = different public IPs after NAT.
Problem 9
- External API sees: 54.23.45.67
- Will request succeed? YES (54.23.45.67 is in the allowlist)
Real-world application: This is why companies give their NAT Gateway IPs to third-party APIs.
Problem 10
- Will it block? NO
- Web Server sees: 45.33.32.1
- Corrected rule:
iptables -A INPUT -s 45.33.32.1 -j DROP
The trap: Routers don't change source IPs. The scanner's real IP passes through.
Section D: Return Traffic
Problem 11
- Point A: SRC=93.184.216.34, DST=203.0.113.5
- Point B: SRC=93.184.216.34, DST=10.0.0.50
- What changes it? NAT connection tracking (conntrack)
Key insight: NAT remembers the original mapping and reverses it for return traffic.
Problem 12
- Point A: SRC=10.0.0.100, DST=72.45.67.89
- Point B: SRC=203.0.113.10, DST=72.45.67.89
Key insight: Conntrack reverses DNATβthe source IP changes back to the public IP so the client recognizes the response.
Scoring
| Section | Questions | Points |
|---|---|---|
| A: Outbound NAT | Q1-Q3 | 30 |
| B: Inbound NAT | Q4-Q5 | 20 |
| C: Troubleshooting | Q6-Q10 | 40 |
| D: Return Traffic | Q11-Q12 | 10 |
Total: 100 points
Passing: 85 points
The Golden Rules
| Rule | Explanation |
|---|---|
| NAT changes source (outbound) | SNAT/MASQUERADE rewrites source IP |
| NAT changes destination (inbound) | DNAT rewrites destination IP |
| Routers DON'T change IPs | They only forward packets |
| Source survives DNAT | Attacker's real IP reaches the server |
| Conntrack reverses translations | Return traffic is automatically handled |
Next Steps
If you scored below 85%, review the problems you missed and retry in 24 hours. Spaced repetition is key.
β Star the GitHub repo for more Security Engineering interview prep materials!
Did this help you? Drop a comment with your score! Let's see how many people can hit 100%.
Top comments (0)