解决方法如下:
原因:
There are multiple known causes for this error:
- You attempted to set a route specific to an interface which was not up at the time you ran the command.
- You attempted to set a route for a network before setting a host route for the gateway which handles traffic for that network.
解决方法:
- At the CLI, type: ifconfig
- If the response shows that the interface you specified in the route command is in an UP state, then create a host route for the gateway and try to set the net route again.
To create a host route
- At the CLI, type: route add -host IP_ADDRESS dev eth0
... where IP_ADDRESS is the IP address of the gateway for the network and eth0 is the actual device name for the ethernet device which connects to the network where the gateway is installed.
To create a net route
- At the CLI, type: route add -net IP_ADDRESS netmask NETMASK gw GATEWAY_IP dev eth0
...where IP_ADDRESS is the IP address of the network, NETMASK is the subnet mask, GATEWAY_IP is the IP address of the gateway machine, and eth0 is the actual interface that connects to the network where the gateway is present.