Router command

Perintah Route
Examples
1. To establish a route so that a computer on one network can send a message to a computer on a different network, type:
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).
2. To establish a route so you can send a message to any user on a specific network, type:
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).
3. To establish a default gateway, type:
route add 0 192.100.13.7
The value 0 or the default keyword for the Destination parameter means that any packets sent to destinations 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.
4. To clear the host gateway table, type:
route -f
5. To add a route specifying weight and policy information, type:
route add 192.158.2.2 192.158.2.5 -weight 5 -policy 4
6. To set the weight and policy attributes of a preexisting route, type:
route set 192.158.2.2 192.158.2.5 -weight 3 -policy



Examples
To display the entire contents of the IP routing table, type:
route print
To display the routes in the IP routing table that begin with 10., type:
route print 10.*
To add a default route with the default gateway address of 192.168.12.1, type:
route add 0.0.0.0 mask 0.0.0.0 192.168.12.1
To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type:
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1
To add a persistent route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type:
route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1
To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and the cost metric of 7, type:
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 7
To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and using the interface index 0x3, type:
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0x3
To delete the route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, type:
route delete 10.41.0.0 mask 255.255.0.0
To delete all routes in the IP routing table that begin with 10., type:
route delete 10.*
To change the next hop address of the route with the destination of 10.41.0.0 and the subnet mask of 255.255.0.0 from 10.27.0.1 to 10.27.0.25, type:
route change 10.41.0.0 mask 255.255.0.0 10.27.0.25

Komentar

Postingan populer dari blog ini

Tip ampuh untuk windows

cerita humoran