04-11-2020 09:10 PM
Hi, I defined 2.2.2.2/8 but when I use the following command --> ip route 2.2.2.0 255.0.0.0 Next hop --> I face "%Inconsistent address and mask". Again when I change my subnet to 255.255.255.0 my command takes effect. Why?
Solved! Go to Solution.
04-12-2020 12:41 PM
Luca is on the right track in the explanation. But I would like to approach the explanation in a different way. If you attempt to configure "ip route 2.2.2.0" you are saying that there are significant digits in first octet, second octet, and third octet. But when you configure the mask as 255.0.0.0 it is say that only octet one is significant. This is the inconsistency that the message is describing. If the routing should really consider first, second, and third octets then the mask needs to be 255.255.255.0.
04-12-2020 12:51 AM
- Because in your case the mask overlaps the address.
M.
04-12-2020 01:01 AM
04-12-2020 01:21 AM
- I think 2.2.2.2/8 denotes Class C
M.
04-12-2020 02:21 AM
Hi,
2.2.2.2/8 is an host address inside the network 2.0.0.0/8.
This means that the range for 2.0.0.0/8 is: 2.0.0.1 - 2.255.255.254 (network and broadcast address excluded).
So, if you configure "ip route 2.2.2.0 255.0.0.0 next-hop" what does the router do?
2.2.2.0/8 is an ip address inside the network 2.0.0.0/8.
The router calculates the network address of that ip and it is 2.0.0.0/8.
So the right command should be ip route 2.0.0.0 255.0.0.0 next-hop.
The command "ip route 2.2.2.0 255.255.255.0 next-hop" works because 2.2.2.0/24 is the correct subnet ID of a subnet inside the network 2.0.0.0/8.
Hope it helps
Luca
04-12-2020 12:41 PM
Luca is on the right track in the explanation. But I would like to approach the explanation in a different way. If you attempt to configure "ip route 2.2.2.0" you are saying that there are significant digits in first octet, second octet, and third octet. But when you configure the mask as 255.0.0.0 it is say that only octet one is significant. This is the inconsistency that the message is describing. If the routing should really consider first, second, and third octets then the mask needs to be 255.255.255.0.
04-12-2020 11:47 PM
04-13-2020 07:53 AM
You are welcome. I am glad that my explanation was helpful.
As far as this route is concerned "ip route 2.0.0.0 255.255.255.0 NextHop" yes it is valid and would be accepted and takes effect. What it is saying is that there are 3 octets that are significant and must match. In your original post you were talking about 2.2.2.2 (or about 2.2.2.0). Note that this ip route would not match the 2.2.2.x address.
You are correct that in a wild card mask that a 0 is significant. But ip route does not use a wildcard mask but uses a subnet mask in which 0 is not significant.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide