Netpractice 42 Tutorial -
Mastering NetPractice: The 42 Project Survival Guide NetPractice is one of those projects in the 42 curriculum that feels like a sudden detour into a completely different world. After months of C programming and memory management, you are suddenly dropped into a browser interface and told to fix a network you can't even "see" in code.
But don't panic. NetPractice isn't about code; it’s about the "plumbing" of the internet. By the end of these 10 levels, you’ll understand how data actually finds its way from your computer to a server halfway across the world. The Core Concepts You Need to Survive
Before you touch the levels, you need to understand three key "rules of the road." 1. The IPv4 Address and the Mask
Every device has an IP address (e.g., 192.168.1.5). However, an IP address is useless without its Subnet Mask.
The Network Part: The part of the IP that identifies which "neighborhood" the device belongs to.
The Host Part: The part that identifies the specific "house" in that neighborhood.
The Mask: Tells you where the neighborhood ends and the house begins. A mask of /24 (or 255.255.255.0) means the first 24 bits are the network. 2. The Golden Rule of Communication
For two devices to talk directly (without a router), they must be on the same network. This means: They must have the same network portion of their IP. They must have the same Subnet Mask. 3. Reserved Addresses netpractice 42 tutorial
In every network, two addresses are "off-limits" for devices: Network Address: The very first address (e.g., .0).
Broadcast Address: The very last address (e.g., .255).If you try to assign these to a host, the level will fail. Level-by-Level Breakdown Levels 1–3: The Basics of "Same Network"
These levels focus on direct communication. You’ll typically see two clients (A and B) that can’t talk.
The Fix: Check the mask. If Client A is 10.0.0.1/24, Client B must also be 10.0.0.X/24. If they have different masks, they won't recognize each other as being in the same "room". Levels 4–6: Introducing the Router
Routers are the "middlemen." A router has multiple interfaces, each belonging to a different network.
The Routing Table: This is where the magic happens. A host needs to know: "If I want to reach a network I'm not on, which IP (Gateway) should I send my data to?"
Default Gateway: Usually, this is the IP of the router interface connected to your network. Levels 7–10: The Internet and Private IPs The final levels introduce "Public" vs "Private" IPs. Final Challenge: Build a Balanced Network For the
NetPractice is a core project at 42 school that introduces the fundamentals of networking without writing a single line of code. It consists of 10 levels of interactive exercises where you must configure IP addresses, subnet masks, and routing tables to enable communication between various machines and routers. 1. Essential Theory Checklist
Before diving into the exercises, you must master these concepts:
Here’s a step-by-step write-up / tutorial for NetPractice (the 42 network configuration exercise).
NetPractice is a web-based mini-game where you fix broken TCP/IP networks by configuring IP addresses, subnet masks, and routes.
Final Challenge: Build a Balanced Network
For the capstone, the tutorial handed Lena an objective: keep average latency below 120 ms, maintain 99.9% availability in a simulated 24-hour period, and ensure zero unauthorized access. She composed policies—redundant routes, prioritized traffic, strict firewall rules with exception lists, and active monitoring.
Over the simulated day, a series of events tested her design: a DDoS spike, a link failure, and a misconfigured app sending large telemetry. Each time, her policies absorbed the shock. When the final report appeared, metrics gleamed green. The tutorial released a small animated badge: "NetPractice 42 — Practitioner."
Lena leaned back, realizing the real lesson: networks are living systems shaped by choices. NetPractice had taught her not only commands and configurations, but the rhythms of tradeoffs—latency versus security, speed versus cost. She closed the tutorial and carried the quiet confidence of someone who had shepherded packets through storms and kept users connected.
—End—
2.3 The Default Gateway
The gateway is the router that a device uses to reach outside its own subnet. If a computer wants to talk to another computer on a different network, it sends the packet to its default gateway.
NetPractice mantra: Two devices can only communicate directly if they share the same network ID (after applying their respective subnet masks).
4. How to Read CIDR Notation
You will often see IPs written like 192.168.1.1/24. The /24 indicates how many bits are set to 1 in the mask.
/24->11111111.11111111.11111111.00000000->255.255.255.0/16->11111111.11111111.00000000.00000000->255.255.0.0/8->11111111.00000000.00000000.00000000->255.0.0.0
Tricky ones:
/25->255.255.255.128(Network split in half)./26->255.255.255.192(Network split into quarters).
Level 3 – Multiple Routers & Routing Tables
Scenario: Non-directly connected networks. Routers need static routes.
Rule: A router must know where to send packets for a destination network (next-hop IP).
Example:
R1 wants to reach 192.168.2.0/24 via R2:
⇒ Add route on R1: 192.168.2.0/24 via 10.0.0.2 What If You’re Still Stuck?
Routing table syntax in NetPractice:
Destination network → Next hop IP
💡 Debug tip: If ping fails from Client to Server, check every router’s routing table step-by-step.
What If You’re Still Stuck?
- Start over with a clean sheet of paper. Define each link’s subnet first.
- Use an online subnet calculator (allowed – 42 tests understanding, not memorization).
- Ask peers – NetPractice is famously easier after someone explains one level to you.
- Watch a video walkthrough – but only after trying yourself for 30 minutes.