Valid or Not
Lesson 8 of 46 in Coddy's IP Addressing and Subnetting course.
Because every octet is one byte, a valid IPv4 address obeys two rules: exactly four numbers joined by dots, and every number between 0 and 255.
That makes bad addresses easy to spot: 192.168.300.5 breaks the range rule, and 1.2.3.4.5 has one octet too many. Typos like these are a classic source of "why can't these machines see each other" tickets, so checking addresses by eye is a real job skill.
Challenge
EasyThe file addresses.txt holds six candidate addresses, one per line. Inspect it with cat, decide which entries are valid IPv4 addresses, and print only the valid ones, in the order they appear in the file.
Expected output:
10.0.0.1
8.8.8.8
255.255.255.255Try it yourself
All lessons in IP Addressing and Subnetting
10Capstone - The Office
The Floor PlanSizing Each TeamCarving the BlockThe Router's ViewRecap - Ship the PlanPractice on your own: Terminal playground