command line bug?

  • Thread starter Thread starter Fred Marshall
  • Start date Start date
F

Fred Marshall

If I run this command:

route -p ADD 172.020.109.012 MASK 255.255.255.252 192.168.109.254 METRIC
3



It responds with:



The route addition failed: The specified mask parameter is invalid.
(Destination
& Mask) != Destination.



But, if I run this command:



route -p ADD 172.20.109.12 MASK 255.255.255.252 192.168.109.254 METRIC 3



it works.....



Is this a bug or don't I understand?



Thanks,

Fred
 
"Fred Marshall" said:
If I run this command:

route -p ADD 172.020.109.012 MASK 255.255.255.252 192.168.109.254 METRIC
3
It responds with:

The route addition failed: The specified mask parameter is invalid.
(Destination
& Mask) != Destination.

But, if I run this command:

route -p ADD 172.20.109.12 MASK 255.255.255.252 192.168.109.254 METRIC 3

it works.....

Is this a bug or don't I understand?

Thanks,

Fred

The first command has "020" in the second octet of the destination
field. The second command has "20".

A number starting with a zero is interpreted as octal, so "020" and
"20" are different numbers:

020 = 20 octal = 16 decimal
20 = 20 decimal
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
"Steve said:
The first command has "020" in the second octet of the destination
field. The second command has "20".

A number starting with a zero is interpreted as octal, so "020" and
"20" are different numbers:

020 = 20 octal = 16 decimal
20 = 20 decimal

On closer inspection, I see that I had the right idea in my first
reply, but I got the details wrong. "020" and "20" are both OK in the
second octet. It's the "012" vs. "12" in the fourth octet that causes
the problem:

012 = 12 octal = 10 decimal = 00001010 binary

In the fourth octet, the logical AND of the subnet mask and the
destination address is:

11111100 AND 00001010 = 00001000

The "route add" command correctly reports that the value of the AND
(00001000) doesn't equal the destination (00001010). In other words,
the route is invalid because it can't match any IP addresses.
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
Steve Winograd said:
On closer inspection, I see that I had the right idea in my first
reply, but I got the details wrong. "020" and "20" are both OK in the
second octet. It's the "012" vs. "12" in the fourth octet that causes
the problem:

012 = 12 octal = 10 decimal = 00001010 binary

In the fourth octet, the logical AND of the subnet mask and the
destination address is:

11111100 AND 00001010 = 00001000

The "route add" command correctly reports that the value of the AND
(00001000) doesn't equal the destination (00001010). In other words,
the route is invalid because it can't match any IP addresses.

Ah! Octal. Thanks Steve!
 
"Fred Marshall" said:
Ah! Octal. Thanks Steve!

You're welcome, Fred. I tend to think in octal. I worked for many
years on a Control Data Corporation 6400, which had 60-bit (20 octal
digits) data registers and 18-bit (6 octal digits) address and index
registers.
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
Back
Top