联系

IP 地址与子网划分简化(适用于 CCNA)

首页 / 博客

4 分钟阅读
ZILL E ALI2025年6月28日思科网络

简化子网划分 CCNA:一旦你理解逻辑,便不再可怕

采用简化子网划分 CCNA 风格意味着更少的记忆规则,更多的逻辑遵循。

子网划分是 CCNA 的一部分, 决定大多数候选人的成败. 起初看起来很吓人——二进制运算、网络位、主机位——但一旦你掌握了逻辑, 一切都明朗起来.

本指南将带你了解:

  • IP 地址和子网划分到底是什么
  • 如何将网络拆分为子网
  • 如何快速解答子网划分问题

如果你厌倦了在不理解的情况下记忆子网表格,这篇博客适合你。


🌐 什么是 IP 地址?

每个 网络上的设备 需要一个唯一的 IP 地址 来通信。

IP 地址看起来像这样:

它由以下部分组成:

  • 网络部分: 标识网络
  • 主机部分: 标识具体设备

🧮 有类 IP 地址(快速回顾)

类 范围 默认子网掩码 使用
A 1.0.0.0 – 126.255.255.255 255.0.0.0 (/8) 大型网络
B 128.0.0.0 – 191.255.255.255 255.255.0.0 (/16) 中型
C 192.0.0.0 – 223.255.255.255 255.255.255.0 (/24) 小型

提示: 无类地址(CIDR)是我们现在使用的,但这仍有助于子网设计逻辑。


🧩 CIDR 表示法说明

而不是写完整的子网掩码,例如 255.255.255.0,我们使用 CIDR:

这里, /24 表示前 24 位是 网络部分. The remaining bits are for hosts.

CIDR Subnet Mask Hosts per Subnet
/24 255.255.255.0 254
/25 255.255.255.128 126
/26 255.255.255.192 62
/27 255.255.255.224 30

🔍 Why Subnetting Matters

🔒 Security:

Split departments (HR, Sales, IT) into different subnets for access control.

🚀 Performance:

Reduces broadcast domains = faster communication.

📈 Scalability:

Lets you efficiently assign IPs and avoid wasting addresses.


🧮 Step-by-Step: How to Subnet (Made Easy)

Let’s say you’re given this:

You need 4 subnets from 192.168.1.0/24

✏️ Step 1: Convert Needed Subnets to Bits

2ⁿ ≥ 4 → n = 2 (because 2² = 4)

You’ll borrow 2 bits from host portion:

  • /24 becomes /26
  • New subnet mask: 255.255.255.192

✏️ Step 2: Calculate Subnet Increments

Block size = 2⁸ – subnet bits = 64

Subnets:

  • 192.168.1.0
  • 192.168.1.64
  • 192.168.1.128
  • 192.168.1.192

✏️ Step 3: Assign Subnets

Subnet 范围 Broadcast Usable IPs
0 .1 – .62 .63 62 hosts
64 .65 – .126 .127 62 hosts
128 .129 – .190 .191 62 hosts
192 .193 – .254 .255 62 hosts

📚 Subnetting Practice Example

Question:
You need to create at least 5 subnets from a 192.168.1.0/24 network, and each subnet must support at least 30 hosts. What subnet mask and CIDR should you use?

Working it through:

  • For at least 5 subnets: 2ⁿ ≥ 5 → n = 3 (2³ = 8 subnets, the smallest power of 2 that covers 5)
  • Borrowing 3 bits from the host portion of a /24 gives /27
  • Check the host requirement: a /27 leaves 5 host bits → 2⁵ – 2 = 30 usable hosts per subnet – exactly enough

Answer: /27, subnet mask 255.255.255.224, giving 8 subnets of 30 usable hosts each. This is the exact kind of two-constraint question (minimum subnets AND minimum hosts) the real exam asks – always check both numbers against your chosen CIDR before finalizing it, since satisfying only one of the two is a common wrong-answer trap.

VLSM: Subnets of Different Sizes

Every example above assumes every subnet is the same size, which wastes addresses in the real world – a point-to-point WAN link between two routers needs only 2 usable addresses, not 62. Variable Length Subnet Masking (VLSM) is subnetting a subnet again, using a different, more appropriate mask for each segment based on how many hosts it actually needs.

The practical rule: size the biggest subnet first, then work down to the smallest. For a network needing one 50-host LAN, one 20-host LAN, and one 2-host WAN link from 192.168.1.0/24:

Segment Hosts needed CIDR Subnet
LAN A 50 /26 (62 usable) 192.168.1.0/26
LAN B 20 /27 (30 usable) 192.168.1.64/27
WAN link 2 /30 (2 usable) 192.168.1.96/30

This is a real, frequently tested CCNA topic precisely because it mirrors how addressing is actually planned on a real network – nobody hands a /30 point-to-point link a /24’s worth of wasted addresses.

Tools & Resources for Fast Practice

🙋‍♂️ FAQ – Google-Ranked Questions

What is subnetting in simple words?

Subnetting is dividing one large network into smaller, more manageable networks.

How do I calculate subnet masks?

Use powers of 2 to calculate how many bits you need to borrow. Then convert to CIDR.

What’s the difference between IP address and subnet mask?

An IP address identifies a device; the subnet mask defines what part is network vs. host.

Do I need to know binary for CCNA subnetting?

Yes, a basic understanding of binary is essential — at least enough to convert and calculate subnet blocks.

Wildcard Masks: Subnet Masks’ Inverted Cousin

ACLs and OSPF’s 网络 statements do not use a subnet mask – they use a wildcard mask, which is the inverse. This single point of confusion costs more CCNA candidates points than almost anything else in this topic area:

Subnet mask:    255.255.255.0
Wildcard mask:    0.0.0.255

The quick way to calculate a wildcard mask without re-deriving it from scratch: subtract each octet of the subnet mask from 255. A /27 (255.255.255.224) becomes a wildcard of 0.0.0.31. This is exactly why an access-list 或 router ospf network line that looks like it has the subnet mask typed backwards is often correct – it is supposed to be inverted.

如果你更愿意有人一步步带你完成此过程,或者需要特定的 Packet Tracer 实验完成并解释,而不是自己摸索,请查看 CCNA 与 Packet Tracer 辅导 页面了解其工作原理。

作者

ZILL E ALI

拥有 MTCNA 和 MTCRE 认证的网络工程师、ISP 基础设施专家,Developer Zon 创始人。在此撰写关于 MikroTik、Cisco、ISP 基础设施以及偶尔的构建日志。

留下回复

本站使用 Akismet 来减少垃圾评论。了解您的评论数据如何被处理。