On Solaris or OpenSolaris, you can use the route
command to show the network routing table information.
To show the complete routing table, use the -n
flag to display the routing table in numeric form:
route -n
This will show you the network routes, the interface through which the route is reachable, the destination network, and the gateway.
To show the default route, use the -n
flag with the -f
flag to display the routing table in numeric form, and filter the output to show only the default route:
route -nf inet
This will show you the default route for IPv4 connections. To show the default route for IPv6 connections, use the inet6
keyword instead:
route -nf inet6
To show the routing table for a specific network interface, use the -n
flag with the -if
flag and the name of the interface. For example:
route -nif hme0
This will show you the routing table for the hme0
interface.
Note: These commands require root privileges to execute.