Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

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

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

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

like image 645
Ben Avatar asked Aug 28 '13 20:08

Ben


People also ask

How do I show IP route on Mac?

To open a terminal session, double-click on "Terminal. app". Inside the Terminal application, the route print command is "netstat -nr". This will display the current routing table for the logged-in user.

How do I flush routing table on Mac?

Use route -n flush several times . Afterwards add your routes with route add.

How do I set a default route on Mac?

Go to System Preference >> Network, and you can "Set Service Order" of the network interfaces and effectively change the default route order in the routing table.

What does show IP route do?

On a Cisco router, the show ip route command is used to display the IPv4 routing table of a router. A router provides additional route information, including how the route was learned, how long the route has been in the table, and which specific interface to use to get to a predefined destination.


1 Answers

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

like image 126
Carl Norum Avatar answered Oct 06 '22 06:10

Carl Norum