Menu
Coddy logo textTech

Giving a Host an Address

Lesson 5 of 35 in Coddy's LAN Labs course.

An IPv4 address plus a prefix length is the whole identity of a host on a LAN: 192.168.1.10/24 says "I am .10, and everything in 192.168.1.0 to .255 is my neighborhood".

netlab ip HOST ADDR/PREFIX assigns it. The lab answers with the derived facts you would otherwise compute by hand: the mask (255.255.255.0 for /24) and the network the host now belongs to (192.168.1.0/24).

Two hosts can talk directly only when they land in the same network, so those derived lines are worth reading every time.

challenge icon

Challenge

Beginner

pc1 and pc2 are cabled to sw1. Give pc1 the address 192.168.1.10/24 and pc2 the address 192.168.1.20/24.

Expected output:

pc1 eth0: 192.168.1.10/24 (mask 255.255.255.0, network 192.168.1.0/24)
pc2 eth0: 192.168.1.20/24 (mask 255.255.255.0, network 192.168.1.0/24)

Try it yourself

Terminal

All lessons in LAN Labs

Practice on your own: Terminal playground