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 (theDestination
parameter). - The
192.100.13.7
address is that of the routing computer (theGateway
parameter).
- The
- 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 (theDestination
parameter). - The
192.100.13.7
address is that of the routing network (theGateway
parameter).
- The
- Example 3:
To establish a default gateway, specify:
route add 0 192.100.13.7
The value
0
, or the defaultph
, for theDestination
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. The192.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