Assigning a 31-Bit Subnet Mask to an IPv4 Address
To conserve address space, you can assign a 31-bit subnet mask to an IPv4 address.
You can configure an IPv4 address with a 31-bit subnet mask on any interface (for example, Ethernet, loopback, VE, or tunnel interfaces).
You cannot configure a secondary IPv4 address with a 31-bit subnet mask on any interface. The following error message is displayed when a secondary IPv4 address with a 31-bit subnet mask is configured: Error: Cannot assign /31 subnet address as secondary.
- Enter global configuration mode.
- Enter interface configuration mode.
- Configure an IP address with a 31-bit subnet mask.
Using CIDR format, the IP address is 10.9.9.9/31.
- Return to privileged EXEC mode.
- To see when a 31-bit subnet mask is used, use the
show ip routecommand.device# show ip route Total number of IP routes: 2 Type Codes - B:BGP D:Connected O:OSPF R:RIP S:Static; Cost - Dist/Metric BGP Codes - i:iBGP e:eBGP OSPF Codes - i:Inter Area 1:External Type 1 2:External Type 2 Destination Gateway Port Cost Type Uptime 1 10.9.9.8/31 DIRECT e 1/1/5 0/0 D 1m53s 2 10.9.9.10/31 DIRECT e 1/1/6 0/0 D 1m54s