Generic selectors

Exact matches only

Search in title

Search in content

Post Type Selectors
Filter by Categories

ACI

Business

Edu

health

homelab

kids

Python

spon

Tech Blogs

Uncategorized

voip

VXLAN

Work Notes

IPv6 notes

The 3 Golden Rules of IPv6 Compression

If you follow these three rules, you will never format an IPv6 address incorrectly:

Rule 1: You can drop leading zeros in any block.

  • 0001 becomes 1
  • 0db8 becomes db8
  • 0000 becomes 0

Rule 2: The :: can replace any contiguous blocks of all zeros.

  • fe80:0:0:0:0:0:0:1 becomes fe80::1

Rule 3: You can only use :: ONCE per address.

  • This is the most critical rule. If you use it twice, the computer cannot do the math to figure out how many zeros go in each spot.
  • Invalid: 2001::abcd::1 (The computer doesn’t know if this means 4 zero blocks then 2 zero blocks, or 2 zero blocks then 4 zero blocks).
  • Fix: If you have two separate chunks of zeros, you must use :: on the longest chunk, and use single 0s for the other. Example: 2001:0:0:abcd::1. (If the chunks are equal in length, standard practice is to compress the leftmost chunk).

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *