IP NAT Pool Command Subnet Mask Behavior

The ip nat pool command is a crucial tool in network configuration, allowing the definition of a range of IP addresses for Network Address Translation (NAT) with a specified subnet mask. Here’s a breakdown of important aspects to understand:

  1. Basic Command Structure: The command format ip nat pool [name] [start-ip] [end-ip] netmask [subnet-mask] defines a NAT pool. For example, ip nat pool CISCO 9.9.9.0 9.9.9.3 netmask 255.255.255.252 sets up a pool from 9.9.9.0 to 9.9.9.3 using a 255.255.255.252 subnet mask.

  2. Subnet Awareness: The NAT process inherently respects the subnet mask, ensuring that network and broadcast addresses are not allocated to hosts within the range. This avoids allocation issues in network communication.

  3. Flexibility and Overlap: The command is versatile and can handle non-standard configurations. For example, configuring ip nat pool MYPOOL 192.168.1.1 192.168.1.254 netmask 255.255.255.128 gives NAT addresses across:

    • 192.168.1.1 to 192.168.1.126
    • 192.168.1.129 to 192.168.1.254 It automatically excludes unusable network (192.168.1.128) and broadcast (192.168.1.127) addresses based on the subnet mask.
  4. Complex Configurations: An extreme setup like ip nat pool MYPOOL 192.168.0.0 192.168.7.255 netmask 255.255.255.240 results in distribution across 128 subnets, while still excluding inappropriate addresses for each subnet.

Overall, while excluding network and broadcast addresses manually might be cleaner for some configurations, the ip nat pool command will manage these exclusions automatically.

https://networklessons.com/cisco/ccie-routing-switching/how-to-configure-dynamic-nat-on-cisco-ios-router/