NAT prefix-length keyword on nat pool command

When implementing Network Address Translation (NAT) on a Cisco IOS device, and when using the nat pool command, the prefix-length keyword is used at the end of the command like so:

NAT(config)#ip nat pool MYPOOL 192.168.23.10 192.168.23.20 prefix-length 24

The prefix-length keyword and the value after it is not used to define the range of addresses in the pool, since the range is clearly defined by the “start IP” and “end IP” addresses in the ip nat pool command.

The prefix length indicates the subnet mask of the translated address to determine if a packet needs to be sent directly to the host (if it is in the same subnet) or to the next hop router (if it is in a different subnet).

Links:

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

https://forum.networklessons.com/t/how-to-configure-dynamic-nat-on-cisco-ios-router/893/45?u=lagapides