Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FreeBSD list the outgoing interface for packets to a specific IP destination
Page 1 of 1

Author:  mandrei99 [ Mon Jul 22, 2013 10:12 am ]
Post subject:  FreeBSD list the outgoing interface for packets to a specific IP destination

Man route quote:
# man route
ROUTE(8) FreeBSD System Manager's Manual ROUTE(8)

route -- manually manipulate the routing tables

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

The route utility is used to manually manipulate the network routing
tables. It normally is not needed, as a system routing table management
daemon, such as routed(8), should tend to this task.

The route utility supports a limited number of general options, but a
rich command language, enabling the user to specify any arbitrary request
that could be delivered via the programmatic interface discussed in

The following options are available:

-d Run in debug-only mode, i.e., do not actually modify the routing

-n Bypass attempts to print host and network names symbolically when
reporting actions. (The process of translating between symbolic
names and numerical equivalents can be quite time consuming, and
may require correct operation of the network; thus it may be
expedient to forget this, especially when attempting to repair
networking operations).

-t Run in test-only mode. /dev/null is used instead of a socket.

-v (verbose) Print additional details.

-q Suppress all output from the add, change, delete, and flush com-

The route utility provides the following commands:

add Add a route.
flush Remove all routes.
delete Delete a specific route.
del Another name for the delete command.
change Change aspects of a route (such as its gateway).
get Lookup and display the route for a destination.
monitor Continuously report any changes to the routing information
base, routing lookup misses, or suspected network partition-

The monitor command has the syntax:

route [-n] monitor

The flush command has the syntax:

route [-n] flush [family]

Get the outgoing interface for traffic destined for specific IP address.
# route get
   route to:
destination: default
       mask: default
  interface: vlan10
recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0 

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group