Monday 14, Apr 2025
We are moved to new domain
Click -> www.ehowtonow.com
Saturday, 26 August 2017

route - Linux Command

route

route [options] [command]
TCP/IP command. Add or remove entries in the routing tables maintained by routed. route accepts two commands: add, to add a route, and del, to delete a route. The two commands have the following syntax:
add [-net | -host] address [modifiers] del [-net | -host] address [modifiers]
address is treated as a plain route, unless -net is specified or address is found in /etc/networks. -host can be used to specify that address is a plain route whether or not it is found in /etc/networks. Using route modifiers, you can specify the gateway through which to route packets headed for that address, its netmask, TCP mss, or the device with which to associate the route; you can also mask certain routes. Only a privileged user may modify the routing tables.

If no command is specified, route prints the routing tables.

Options

-A family, --family
Specify an address family to use with an add or del command. family may be inet, inet6, ax25, netrom, ipx, ddp, or x25.

-C, --cache
Perform command on the routing cache instead of the forwarding information base (FIB) routing table.

-e, --extend
Use netstat -r format to print routing table. Use twice to print extended information. Same as netstat -ree.

-F, --fib
Perform command on the forwarding information base (FIB) routing table. This is the default behavior.

-h, --help
Print help message, then exit.

-n, --numeric
Show numerical addresses; do not look up hostnames. (Useful if DNS is not functioning properly.)

-v, --verbose
Verbose mode.

-V, --version
Print version and configuration options, then exit.

Route modifiers

[dev] interface
Associate route with specified device. When the interface is given as the last argument on a command line, the word dev is optional.

netmask mask
Use netmask mask.

gw gateway
Route packets through gateway.

metric n
Set routing metric to n.

mss bytes
Set maximum segment size for connections over this route.

reject
Cause route lookup for target to fail. Used to mask out networks from a default route.

Example

Add a default gateway for interface eth0:

route add default gw 192.168.0.1 dev eth0

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer

Related Posts:

  • ssh-keygen Linux Command ssh-keygen ssh-keygen [options] Generate, manage, and convert authentication keys for ssh. When using ssh-keygen to create a key, the -t option must be specified to identify the type of key to create. Options -b bits … Read More
  • Diff Linux Command diff diff [options] [diroptions] file1 file2 Compare two text files. diff reports lines that differ between file1 and file2. Output consists of lines of context from each file, with file1 text flagged by a < symbol and… Read More
  • Linux Commands Change Directory cd Linux Command Change Access Permission chmod Linux Command Accept Linux Command aclocal Linux Command mkdir Create directory Linux Command cp Copy Linux Command SCP Securely copy files between hosts on … Read More
  • SSH Linux Command ssh ssh [options] hostname [command] Securely log a user into a remote system and run commands on that system. The version of ssh described here is the OpenSSH client. ssh can use either Version 1 (SSH1) or Version 2 (SSH… Read More
  • tail Linux Command tail tail [options] [files] Print the last 10 lines of each named file (or standard input if - is specified) on standard output. If more than one file is specified, the output includes a header at the beginning of each fi… Read More
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

Item Reviewed: route - Linux Command Rating: 5 Reviewed By: eHowToNow