Skip to content

Network configuration and troubleshooting exercises focusing on TCP/IP addressing, subnetting, and routing. 10 progressive levels covering subnet masks, CIDR notation, network segmentation, and routing tables. Part of 42 School curriculum.

Notifications You must be signed in to change notification settings

whoismtrx/42_NetPractice

Repository files navigation

NetPractice

Overview

NetPractice is a practical networking exercise designed to teach you the fundamentals of computer networking. Through 10 interactive levels, you'll learn how to configure IP addresses, understand subnetting, set up routing tables, and connect devices through routers and switches.

This project provides hands-on experience with TCP/IP addressing, subnet masks and CIDR notation, default gateways and routing, network topology design, IP address allocation, and network troubleshooting. The training interface simulates network configurations where you must fix non-functioning networks by correctly configuring IP addresses, subnet masks, and routing information.

Key Features

10 Interactive Levels: Progressive difficulty from basic IP addressing to complex multi-router topologies

Hands-on Configuration: Configure IP addresses, subnet masks, gateways, and routing tables

Real-world Scenarios: Practice with switches, routers, and network segmentation

Instant Feedback: Test your configurations and receive immediate validation

Export Configurations: Save your solutions as JSON files for submission

Getting Started

Download and Setup

Download the NetPractice training interface from the 42 intranet and extract the files:

# Extract the archive
unzip netpractice.zip
# or
tar -xvf netpractice.tar

# Open the interface
open index.html

Using the Interface

  1. Enter your 42 login when prompted (required for configuration persistence)
  2. Complete each level by configuring the editable fields (unshaded areas)
  3. Click "Check again" to verify your solution
  4. Export your configuration with "Get my config" button
  5. Save all 10 configuration files for submission

Networking Fundamentals

IP Addressing

IP addresses uniquely identify devices on a network. IPv4 addresses consist of four octets (0-255) divided into network and host portions.

Private IP Ranges (RFC 1918): • Class A: 10.0.0.0/8 (10.0.0.0 - 10.255.255.255) • Class B: 172.16.0.0/12 (172.16.0.0 - 172.31.255.255) • Class C: 192.168.0.0/16 (192.168.0.0 - 192.168.255.255)

Subnet Masks and CIDR

Subnet masks determine which portion of an IP address represents the network versus the host.

Common Subnet Masks:

/24 = 255.255.255.0     (254 hosts)
/25 = 255.255.255.128   (126 hosts)
/26 = 255.255.255.192   (62 hosts)
/27 = 255.255.255.224   (30 hosts)
/28 = 255.255.255.240   (14 hosts)
/29 = 255.255.255.248   (6 hosts)
/30 = 255.255.255.252   (2 hosts - ideal for point-to-point)

Network Components

Gateway: Router interface that connects your local network to other networks. Must be in the same subnet as the device.

Switch: Layer 2 device that connects devices within the same network. Does not have an IP address.

Router: Layer 3 device that connects different networks. Each interface has its own IP address in a different subnet.

Key Rules

• All devices in the same network must be in the same subnet • Each device must have a unique IP address • Gateway must be in the same subnet as the device • Cannot use network address (first) or broadcast address (last) • Networks cannot overlap

Level Strategy

General Approach

  1. Identify the topology: Count networks, locate routers and switches
  2. Check what's editable: Focus on unshaded (editable) fields
  3. Assign IP addresses: Keep devices in same network in same subnet
  4. Configure gateways: Must be in same subnet as devices
  5. Set up routing: Use 0.0.0.0/0 for default routes
  6. Test and verify: Click "Check again" and adjust based on errors

Common Patterns

Level 1-3: Basic IP addressing and gateway configuration
Level 4-6: Multiple networks, router interfaces, subnet planning
Level 7-10: Complex topologies, routing tables, efficient IP allocation

Common Mistakes

• Using different subnet masks for devices in the same network
• Gateway IP outside the client's subnet
• Assigning network or broadcast addresses to devices
• Creating overlapping networks
• Duplicate IP addresses
• Incorrect next hop in routing tables

Resources

TCP/IP Guide
RFC 791 - Internet Protocol
RFC 1918 - Private Address Space
Subnetting Practice

Project Structure

Place all 10 configuration files at the root of your repository:

netpractice/
├── level1.json
├── level2.json
├── level3.json
├── level4.json
├── level5.json
├── level6.json
├── level7.json
├── level8.json
├── level9.json
├── level10.json
└── README.md

Disclaimer

This repository is for educational purposes only, documenting my work on the 42 curriculum. These solutions are intended as a reference for students who have already completed or are actively working on the project.

About

Network configuration and troubleshooting exercises focusing on TCP/IP addressing, subnetting, and routing. 10 progressive levels covering subnet masks, CIDR notation, network segmentation, and routing tables. Part of 42 School curriculum.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published