Cisco CLI Error: % Inconsistent address and mask
When does this error appear?
What does this error mean?
This error indicates that the network address specified in the command is not a valid network address for the subnet mask specified.
The basic format of the ip route command as follows:
ip route <network address> <subnet mask> <next-hop address>
For example:
ip | route | 192.168.1.0 | 255.255.255.0 | 10.0.0.1 |
network address | subnet mask | next hop |
The network address parameter must be a valid network address when combined with the subnet mask parameter. When entering the ip route command on a Cisco router, if we see the error message "% Inconsistent address and mask" it indicates to us that the combination of the network address parameter and the subnet mask parameter is incorrect.
Example 1 (Mistake or typo when entering the network address):
Router1 | Router2 | |
Segment 2
172.20.100.96/30 172.20.100.97172.20.100.98
|
||
10.8.0.1 | 10.8.1.1 | |
Segment 1 10.8.0.0/24 Segment 3 10.8.1.0/24 |
ip | route | 10.8.1.1 | 255.255.255.0 | 172.20.100.98 |
network address | subnet mask | next hop |
ip | route | 10.8.1.0 | 255.255.255.0 | 172.20.100.98 |
network address | subnet mask | next hop |
With the correct network address paramer, the router accepts the command:
Example 2 (Mistake or typo when entering the subnet mask):
Router1 | Router2 | |
Segment 2
172.20.100.96/30 172.20.100.97172.20.100.98
|
||
10.8.0.1 | 10.8.1.1 | |
Segment 1 10.8.0.0/24 Segment 3 10.8.1.0/24 |
ip | route | 10.8.1.0 | 255.255.254.0 | 172.20.100.98 |
network address | subnet mask | next hop |
The IP address 10.8.1.0 is not a network address when combined with the subnet mask 255.255.254.0. 10.8.1.0 is the 256th host address in the network 10.8.0.0 255.255.254.0 (/23)
10.8.0.0 255.255.254.0 defines the range of IP address 10.8.0.0 - 10.8.1.255. The network address is 10.8.0.0 and the broadcast address is 10.8.1.255. (10.8.1.0 is a host address within this range.)
The correct subnet mask for this scenario is 255.255.255.0. The correct command would be:
ip | route | 10.8.1.0 | 255.255.255.0 | 172.20.100.98 |
network address | subnet mask | next hop |
With the correct subnet mask paramer, the router accepts the command:
Conclusion
The error message "% Inconsistent address and mask" may appear while attempting to add a static route on a Cisco router. This error message indicates that the combination of the network address and subnet mask parameters does not define a valid network address. If you receive this error message while configuring a static route on a Cisco router, check the network address and subnet mask parameters in the command that you have entered. There is a mistake or typo in either the network address or subnet mask parameter such that the network address as entered is actually a host address.
To gain a comprehensive understanding of Static Routes on Cisco routers, check out the course Course 4 - Static Routes on this website.
Want to test your networking skills with hands-on configuration and troubleshooting questions? Try out the Workshops section of this website here: Workshops (Login required).
Read how to use the device simulators on this website here: Workshops - General Instructions