Example

Examples in using route:

  • Example 1:

    To establish a route so that a computer on one network can send a message to a computer on a different network, specify:

    route add 192.100.201.7 192.100.13.7
    • The 192.100.201.7 address is that of the receiving computer (the Destination parameter).
    • The 192.100.13.7 address is that of the routing computer (the Gateway parameter).
  • Example 2:

    To establish a route so that you can send a message to any user on a specific network, specify:

    route add -net 192.100.201.0 192.100.13.7
    • The 192.100.201.0 address is that of the receiving network (the Destination parameter).
    • The 192.100.13.7 address is that of the routing network (the Gateway parameter).
  • Example 3:

    To establish a default gateway, specify:

    route add 0 192.100.13.7

    The value 0, or the default ph, for the Destination parameter indicates that any packets sent to destinations that were not previously defined and not on a directly connected network, go through the default gateway. The 192.100.13.7 address is that of the gateway chosen to be the default.

  • Example 4:

    To clear the host gateway table, specify:

    route -f
  • Example 5:

    To add a route specifying weight and policy information, specify:

    route add 192.158.2.2 192.158.2.5 -weight 5 -policy 4
  • Example 6:

    To set the weight and policy attributes of a preexisting route, specify:

    route set 192.158.2.2 192.158.2.5 -weight 3 -policy