

Web Appendix-5 (RTERR)
route command error messagesThis appendix lists error messages from the route command for Linux and for Windows, explains what the messages mean, and suggests common causes and how to fix them.
Linux
Notes:
SIOCADDRT: Network is unreachable
route add default gw 1.2.3.4
The routeraddr isn’t on a directly-connected network so this machine would be unable forward packets to it.
SIOCADDRT: File exists
You are adding a route that exists already.
SIOCADDRT: No such device
You omitted the gw keyword before the default gateway address, as in:
route add -net 10.2.2.76/24 10.1.1.22
wrongSIOCDELRT No such process
You have tried to delete a route that doesn’t exist. List the routes with route –n and check the destaddr and netmask that you entered
SIOCADDRT: Operation not supported by device
route add -net 10.0.0.0/8 10.1.1.254
wrongroute add –net 172.23.24.128/25
wrongYou omitted "gw" before the routeraddr or omitted the gateway details completely:
route add -net 10.0.0.0/8 gw 10.1.1.254
correctroute add –net 172.23.24.128/25 gw 10.1.1.22
correctSIOCADDRT: Operation not permitted
You are not running as user root.
SIOCADDRT: Invalid argument
route add -net 10.2.2.0 gw 10.1.1.254
wrongroute del -net 172.23.0.0
wrongYou omitted the netmask a.b.c.d or /numbits when adding / deleting a route to a network.
route add -net 10.2.2.0 netmask 255.255.255.0 gw 10.1.1.254
correctroute add -net 10.2.2.0/24 gw 10.1.1.254
correctroute del -net 172.23.0.0/16
correctroute del -net 172.23.0.0 netmask 255.255.0.0
correctroute: netmask doesn't match route address followed by "usage" message:
route add -net 10.7.8.9 netmask 255.0.0.0 gw 10.1.1.22
wrongThe destaddr isn’t a network address in the sense explained in BACKREF(Module 4.XXX) – it must be the lowest address in the range:
route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.1.1.22
correctroute: netmask 00ffffff doesn't make sense with host route followed by "usage" message:
route add 10.1.1.64/26 gw 10.1.1.254
wrongMost likely: you omitted "-net" by mistake, when adding / deleting a route to a network:
route add -net 10.1.1.64/26 gw 10.1.1.254
correctLess likely: you wrongly inserted a netmask a.b.c.d or /numbits when defining a route to a single host:
route add 10.1.1.64 gw 10.1.1.254
correct
a.b.c.d.e Unknown host
route add -net 10.5.6.7.8/8 gw 10.1.1.254
wrongroute add default gw 1.2.3.4.5
wrongYou have entered a 5-byte destaddr by mistake, which can’t be correct.
addr: Host name lookup failure
route add -net 172.23.0.0 gw 10.1.1.254 netmask 255.255.255.25x
wrongThe netmask isn’t all numeric; route tries to look it up in the DNS to convert it to numeric, and fails.
addr: Unknown host
route add -net 172.23.0.0 gw 10.1.1.22 netmask 255.255.255.256
wrongroute add -net 172.23.0.0 gw 10.1.1.22 netmask 255.257.258.259
wrongThe netmask is numeric but isn’t a valid netmask causing route to misinterpret it
route: bogus netmask 255.255.255.25
route add -net 172.23.0.0 gw 10.1.1.22 netmask 255.225.0.0
wrongroute add -net 172.23.0.0 gw 10.1.1.22 netmask 10.1.1.254
wrongThe netmask is numeric but is invalid. You made a typo entering the netmask (e.g. "225" instead of "255), or entered a host address by mistake, or else you mixed up a destination address with the netmask spec.
route add -net 172.23.0.0 gw 10.1.1.22 netmask 255.255.0.0
correct"usage" message:
route add -net 10.2.2.76 /24 gw 10.1.1.22
wrongThe usage message on its own usually means a syntax error of some kind, so that the command didn’t really make sense, irrespective of the IP address or other settings on this machine. Typical causes are including:
Warning:
Warning: The formats of route add and route del commands and of netstat -r output, are different on different variants of UNIX. (We have often found this confusing, and on Solaris created a point-to-point route inadvertently and wrongly.)
Windows
Notes:
route add 0.0.0.0 10.1.2.3
wrongdoesn’t define a default gateway route. Instead it defines a route to the single host 0.0.0.0, i.e. with a netmask of 255.255.255.255
bad argument netmask
You typed the word netmask instead of mask
route add 0.0.0. mask 0.0.0.0 1.2.3.4
wrongroute delete 10.0.0.0 192.168.20.22 actually removed 10.0.0.0 192.168.20.99
xxx[14-Jun-01 finished here. steal unnecessary items from chap 3, and dup others. Check contents of table and the examples. Then do the "errors"
Problems:
bad destination address destaddr – maybe a name, or "default"
bad destination netmask address : what gave this
you can have silly netmask: route add 5.0.0.0 mask 255.255.255.256 10.2.2.222 = N-256
Also mask bytes less than 255 (but you might content that’s acceptable – because of variable length masks)
Win: How you can change your defgwy without rebooting. Gateway field is different from other IP params – not specific to NIC
findout(does manual default gateway change persist across reboots?)
using the route add metric in NT
whereputXXX[route add 0.0.0.0 MASK 0.0.0.0 <my local ip address>
Thus, packets destined for "non-local" subnets will be transmitted directly onto the local media instead of being sent to a router. In essence, the local interface card can be designated as the default gateway. This might be useful where several class "C" networks are being used on one physical network with no router to the outside world. ]
The route addition failed: 87 (from "route add" command)
The IP address you specified as the default gateway isn’t in the address range directly-connected to this machine, as specified by this machine’s IP address and netmask. E.g. if this is 10.1.1.59 netmask 255.255.255.0 the gateway address must be in the range
10.1.1.0 – 10.1.1.255
(This message could also mean that you don’t have the necessary privileges to add a route.)
(help message printed) (from "route add"command)
You’ve made a mistake in the command syntax. Typical causes are typing "del" instead of "delete", or omitting the gateway IP address, as in
route add 0.0.0.0 mask 0.0.0.0
Win: if you have an impossible gateway entered via Control Panel > Network may not be able to use route command properly – even commands with correct syntax don’t work, with message "no such route" or something. Recreate on timepc.
Notes and further reading
The route addition failed: 87
bibref(MS-KB Q151795) – not network address (lowest in range) or gateway address not on a network directly-connected to this machine
bibref(MS-KB Q163107) – need administrator privilege