Linux/Unix Commands





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
LINUX / UNIX cmd
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Introduction
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in A
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in B
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in C
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in D
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in E
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in F
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in G
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in H
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in I
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in J
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in K
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in L
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in M
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in N
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in P
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in R
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in S
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in T
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in U
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in W
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in Y
Forums Ask your doubts
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example More about Linux
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Feedback
 





route Linux Commands


Tutorials Linux-commands

Topic

What is Linux route Command?



Explanation

route COMMAND:
     route command displays routing table resides in kernel and also used to modify the routing table.The tables which specifies how packets are routed to a host is called routing table.

SYNTAX:
  The Syntax is
     route [options]

OPTIONS:
     
-n dispalys routing table in numerical[IP Address] format
-e dispalys routing table in Hostname format
add Adds a new route to the routing table
del Deletes a route from the routing table

    Options used with add and del :
-net Indicate the target is network
-host Indicate the target is host
gw Specifies the gateway of target host/network
netmask Used to specifiy the subnet-mask of destination network/host
dev Specify the device or interface where the packets will be sent
reject rejects the packets sent to particular route/host



EXAMPLE:
     
  1. To dispaly the routing table:
    route -n

    The above command will print:

    DestinationGatewayGenmaskFlagsMetricRefUseIface
    192.168.0.00.0.0.0255.255.255.0 U 000eth0
    169.254.0.00.0.0.0255.255.0.0 U 000eth0
    0.0.0.0192.168.0.10.0.0.0UG000eth0

    In above table:
    Destination -Indicates the IP address of desination host/network
    Gateway -Indicates gateway from which desination host/network could be reached
    Genmask -Indicates the subnetmask destination
    Flags -Indicates the current status of route
    • U - Route is up
    • H - Target is a host
    • G - Use gateway
    Iface -Indicates the interface

  2. To add static route to a network in the routing table:

    route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth0

    In above command:
    add -Indicates that the route is added to routing table.
    -net -Indicates that desination is a network.
    192.168.0.1-Indicates IP address of destination network.
    netmask-Indicates the subnetmask of destination network.
    gw 192.168.1.1-Indicates the gateway of destination network.
    dev eth0-Indicates that the packets are routed via the interface eth0.

  3. To delete a route from the routing table:

    route del -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth0

    The above command will delete the route to 192.168.1.0 from the routing table.




A Note

Find LINUX Commands... Hope you enjoy this tutorial. We welcome your Valuable feedbacks or suggestions on this LINUX / UNIX cmd reference. This is a copyright content.


Other Links

web hosting

 

Free Hosting

Top Hosting Companies