2

Command route -n of BSD return nothing

$ route -n
usage: route [-dnqtv] command [[modifiers] args]

It's output of GNU version

enter image description here

What's the equivalent in BSD?

2 Answers 2

5

You can use netstat -rn for this purpose.

See the FreeBSD man page on netstat for more details.

Incidentally, that also works in Linux, so in a way it's a more portable command than route -n to inspect the routing tables.

3

On OpenBSD and NetBSD:

route -n show

You forgot to mention the task that you wanted route to do: show. This is also hinted at in the error message that you get.

The Linux route command and the route commands on the different BSD systems are pretty different in their semantics, and the BSD command does not default to showing the routes. The route implementations on FreeBSD and macOS require a specific destination address. You would be better off using netstat -rn on those two systems.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .