Linux 当我在 Mac 终端中输入 `route -n` 时,为什么不显示路由表?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18497905/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 00:41:50  来源:igfitidea点击:

When I type `route -n` into the Mac terminal, why doesn't it show a routing table?

linuxmacosunixnetworkingtcp-ip

提问by Ben

I read in "TCP/IP Network Administration" by O'Reilly, 2002, that typing the route -ncommand should bring up a routing table.

我在 O'Reilly 2002 年的“TCP/IP 网络管理”中读到,键入route -n命令应该会显示一个路由表。

When I typed it into the terminal on a Mac, it returned the following:

当我在 Mac 上的终端中输入它时,它返回以下内容:

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

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

What is the correct command to use to see the routing table in my terminal?

在我的终端中查看路由表的正确命令是什么?

采纳答案by Carl Norum

On Mac OS X you can use netstat(1). In your case, netstat -nr, probably.

在 Mac OS X 上,您可以使用netstat(1). 在你的情况下netstat -nr,可能。