Courseiva
DHCPDHCP Pool Config

network [ip] [mask]

Defines the subnet or network number for the DHCP pool, specifying which IP addresses the DHCP server can assign to clients.

Definition: network [ip] [mask] is a Cisco IOS dhcp pool config command. Defines the subnet or network number for the DHCP pool, specifying which IP addresses the DHCP server can assign to clients.

Overview

The `network` command in DHCP pool configuration mode is a fundamental directive that defines the subnet or network number from which the DHCP server can allocate IP addresses to clients. This command is critical for any Cisco router or switch acting as a DHCP server, as it establishes the address pool scope. Without it, the DHCP pool remains empty and cannot serve any leases.

The command takes two arguments: the network IP address and the subnet mask, which together define the range of assignable addresses. For example, `network 192.168.1.0 255.255.255.0` creates a pool for the 192.168.1.0/24 subnet, allowing addresses 192.168.1.1 through 192.168.1.254 (excluding the network and broadcast addresses). The DHCP server will automatically exclude the network address (e.g., 192.168.1.0) and broadcast address (e.g., 192.168.1.255) from the pool.

This command is typically used in conjunction with other DHCP pool commands like `default-router`, `dns-server`, and `lease` to provide complete client configuration. Network engineers reach for this command when they need to deploy a simple DHCP service on a router, often in small to medium-sized networks where a dedicated DHCP server is not justified. It is an alternative to using an external DHCP server or configuring IP helper addresses to forward DHCP requests to a centralized server.

The command fits into the broader configuration workflow after creating the DHCP pool with `ip dhcp pool <name>` and before specifying additional options. Important IOS behavior: the `network` command is stored in the running configuration and can be viewed with `show running-config | section dhcp`. There are no special privilege level requirements beyond privileged EXEC mode (enable).

The command does not produce buffered output; it simply configures the pool. When the network is changed, existing leases may become invalid, so caution is needed in production environments. The command supports both classful and classless subnet masks, but classless masks are recommended for flexibility.

A common mistake is using the wrong mask, which can either shrink or expand the pool unexpectedly. Another is forgetting that the DHCP server must have an interface in the same subnet to respond to clients; otherwise, an IP helper address is needed. Understanding this command is essential for CCNA and CCNP candidates as it appears in both exam topics and real-world network deployments.

Syntax·DHCP Pool Config
network [ip] [mask]

When to Use This Command

  • Configuring a DHCP pool for a /24 subnet on a LAN segment, e.g., 192.168.1.0/24.
  • Setting up DHCP for multiple VLANs by creating separate pools with different network statements.
  • Assigning IP addresses to a guest wireless network with a specific subnet.
  • Configuring DHCP for a remote branch office subnet via a DHCP relay.

Parameters

ParameterSyntaxDescription
ipA.B.C.DThe network IP address of the subnet from which the DHCP server will assign addresses. This must be the network address (e.g., 192.168.1.0), not a host address. Common mistakes include using a host IP or broadcast address, which will cause the pool to be misconfigured or fail to allocate addresses.
maskA.B.C.D or prefix length (e.g., /24)The subnet mask for the network, specified in dotted decimal format (e.g., 255.255.255.0) or as a prefix length (e.g., /24). The mask defines the size of the address pool. A common mistake is using an incorrect mask that does not match the actual subnet, leading to address exhaustion or overlapping pools.

Command Examples

Basic DHCP Pool Configuration

network 192.168.1.0 255.255.255.0

This command defines the network 192.168.1.0 with a 24-bit mask (255.255.255.0). The DHCP server will allocate addresses from 192.168.1.1 to 192.168.1.254 (excluding the network and broadcast addresses).

Using a Different Subnet Mask

network 10.0.0.0 255.255.255.128

This defines a /25 subnet (mask 255.255.255.128). The DHCP server will assign addresses from 10.0.0.1 to 10.0.0.126. The network address is 10.0.0.0 and broadcast is 10.0.0.127.

Understanding the Output

The network command does not produce output when entered; it simply configures the DHCP pool. To verify, use 'show ip dhcp pool [pool-name]' which displays the network, lease time, and utilization. The output shows the subnet and mask, the number of addresses, and how many are currently allocated.

A healthy pool has low utilization; high utilization (e.g., >90%) may indicate exhaustion. Watch for overlapping subnets across pools.

Configuration Scenarios

Basic DHCP Pool for a Small Office LAN

A small office has a single router (R1) acting as the default gateway and DHCP server for the 192.168.1.0/24 LAN. The goal is to automatically assign IP addresses to workstations and provide DNS server information.

Topology

R1(Gi0/0)---192.168.1.0/24---[Workstations]

Steps

  1. 1.Step 1: Enter global configuration mode: R1> enable
  2. 2.Step 2: Enter global config: R1# configure terminal
  3. 3.Step 3: Create a DHCP pool named OFFICE: R1(config)# ip dhcp pool OFFICE
  4. 4.Step 4: Define the network: R1(dhcp-config)# network 192.168.1.0 255.255.255.0
  5. 5.Step 5: Set default gateway: R1(dhcp-config)# default-router 192.168.1.1
  6. 6.Step 6: Set DNS server: R1(dhcp-config)# dns-server 8.8.8.8
  7. 7.Step 7: Set lease time: R1(dhcp-config)# lease 7
  8. 8.Step 8: Exit DHCP config: R1(dhcp-config)# exit
  9. 9.Step 9: Verify: R1# show ip dhcp binding
Configuration
!
ip dhcp pool OFFICE
 network 192.168.1.0 255.255.255.0
 default-router 192.168.1.1
 dns-server 8.8.8.8
 lease 7
!

Verify: Use `show ip dhcp binding` to see active leases. Expected output shows IP addresses like 192.168.1.2, 192.168.1.3, etc., with MAC addresses and lease expiration times.

Watch out: Ensure the router's interface (Gi0/0) has an IP address in the same subnet (e.g., 192.168.1.1/24). If not, DHCP requests will not reach the router.

DHCP Pool with Exclusions for Static Servers

A network has a DHCP server on a router for the 10.10.10.0/24 subnet, but two servers (10.10.10.10 and 10.10.10.20) require static IP addresses. The goal is to exclude these addresses from the DHCP pool to prevent conflicts.

Topology

R1(Gi0/0)---10.10.10.0/24---[Servers: .10, .20] and [Clients]

Steps

  1. 1.Step 1: Enter global config: R1# configure terminal
  2. 2.Step 2: Exclude static addresses: R1(config)# ip dhcp excluded-address 10.10.10.10 10.10.10.20
  3. 3.Step 3: Create DHCP pool: R1(config)# ip dhcp pool SERVERS
  4. 4.Step 4: Define network: R1(dhcp-config)# network 10.10.10.0 255.255.255.0
  5. 5.Step 5: Set default gateway: R1(dhcp-config)# default-router 10.10.10.1
  6. 6.Step 6: Set DNS: R1(dhcp-config)# dns-server 10.10.10.10
  7. 7.Step 7: Exit: R1(dhcp-config)# exit
  8. 8.Step 8: Verify: R1# show ip dhcp pool
Configuration
!
ip dhcp excluded-address 10.10.10.10 10.10.10.20
ip dhcp pool SERVERS
 network 10.10.10.0 255.255.255.0
 default-router 10.10.10.1
 dns-server 10.10.10.10
!

Verify: Use `show ip dhcp pool` to see the pool utilization. Expected output shows 'Number of addresses' as 254 (total) minus 2 excluded = 252 available. Also use `show ip dhcp binding` to confirm no lease for excluded addresses.

Watch out: The exclusion command must be entered before the pool configuration or at least before clients request addresses. If a client already has a lease for an excluded address, the exclusion will not take effect until the lease expires.

Troubleshooting with This Command

When troubleshooting DHCP issues related to the `network` command, the first step is to verify that the pool is correctly configured. Use `show ip dhcp pool` to display the pool name, network, and address utilization. Healthy output shows a network defined, a reasonable number of addresses (e.g., 254 for /24), and a low utilization percentage.

Problem indicators include 'Network not configured' or '0 addresses' which means the `network` command is missing or misconfigured. Another key command is `show ip dhcp binding` to see active leases. If no leases appear, clients are not receiving addresses.

Check the router's interface IP: it must be in the same subnet as the pool; otherwise, DHCP discover messages are dropped. Use `debug ip dhcp server events` to see real-time DHCP transactions. Look for 'DHCPD: no subnet configured for ...' which indicates the pool's network does not match the client's subnet.

Also check for IP address conflicts with `show ip dhcp conflict`. Common symptoms: clients get 169.254.x.x addresses (APIPA) means DHCP server unreachable; clients get wrong subnet mask or gateway means the `network` command mask is incorrect. A diagnostic flow: 1) Verify pool configuration with `show ip dhcp pool`. 2) Check interface IP with `show ip interface brief`. 3) Ensure no ACLs blocking UDP ports 67/68. 4) Use `debug ip dhcp server packet` to see if requests arrive. 5) Correlate with `show ip dhcp binding` to see if offers are sent.

If the pool is correctly configured but no leases, consider that the router may have multiple pools and the client's subnet might match a different pool. Also, the `network` command does not automatically exclude the router's own IP; if the router's interface IP falls within the pool range, it will be excluded automatically, but it's good practice to explicitly exclude it. Another gotcha: when using classless masks, ensure the network address is correct (e.g., for 10.10.10.0/24, the network is 10.10.10.0, not 10.10.10.1).

Finally, remember that the DHCP server must have a route to the client subnet if not directly connected; otherwise, use `ip helper-address` on the client-facing interface.

CCNA Exam Tips

1.

The network command must match the subnet of the client's interface; otherwise, clients won't get an IP.

2.

The mask can be in dotted decimal or CIDR format (e.g., /24), but IOS expects dotted decimal in the command.

3.

You can configure multiple pools for different subnets; the router selects the pool based on the interface receiving the DHCP request.

4.

Remember that the network command excludes the network and broadcast addresses automatically.

Common Mistakes

Using the wrong subnet mask, causing the pool to cover a different range than intended.

Forgetting to configure a default-router or DNS server, leaving clients without gateway or name resolution.

Creating overlapping pools for different subnets, leading to IP address conflicts.

network [ip] [mask] vs ip dhcp pool [name]

Both commands are essential for configuring a DHCP server on a Cisco router, but they operate at different stages: 'ip dhcp pool [name]' creates the pool and enters its configuration mode, while 'network [ip] [mask]' defines the subnet from which addresses are assigned. They are commonly confused because both are required, and their order matters.

Aspectnetwork [ip] [mask]ip dhcp pool [name]
ScopeDefines subnet for address assignmentCreates pool and enters sub-configuration mode
Configuration modeExecuted in DHCP pool configuration modeExecuted in global configuration mode
PersistenceSaved within the pool configurationCreates a persistent pool entry in running config
PrecedenceMust be issued after pool is createdMust be issued before network command
Typical useSpecify the subnet and mask for clientsInitialize a new DHCP pool and name it

Use network [ip] [mask] when you are already inside a DHCP pool configuration and need to define the subnet that clients will receive addresses from.

Use ip dhcp pool [name] when you need to create a new DHCP pool and enter its configuration mode to set up DHCP parameters.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the `network` command syntax is identical to classic IOS. However, IOS-XE introduces the `ip dhcp smart-relay` feature that can affect DHCP behavior. The output of `show ip dhcp pool` may include additional fields like 'Automatic allocation' and 'Manual allocation'.

In NX-OS (e.g., Nexus switches), the equivalent command is `ip dhcp pool <name>` followed by `network <ip> <mask>` but note that NX-OS uses a different DHCP server implementation. The exact syntax is the same, but NX-OS also supports `ip dhcp relay` for DHCP relay. For ASA firewalls, DHCP server configuration is done via `dhcpd address <ip1>-<ip2> <interface>` and `dhcpd dns <ip>`, not the `network` command.

ASA does not use the `network` command in the same way. In IOS-XR (e.g., ASR 9000), DHCP server configuration is different; it uses `dhcp ipv4` configuration mode with `pool <name>` and `network <ip>/<length>`. The syntax is similar but uses prefix length instead of mask.

For example: `dhcp ipv4 pool POOL1 network 192.168.1.0/24`. In older IOS versions (12.x), the `network` command accepts both dotted-decimal mask and prefix length, but prefix length was introduced later. In 15.x and 16.x, both are supported.

There are no significant behavioral differences across versions for this command. Always verify the exact syntax for your platform using the documentation or `?` help.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions