CyberTek - the future at the present!
Google

Set a route to Linux

Posted by: admin (May 23)

Route is the command that Linux is used to manipulate the routing tables. Allows you to add and delete static route and default gateway, and simply display the routing table of a system. It is not common in other Unix.

route add [-net |-host] address [gateway gw] [netmask netmask] [mss mss] [metric metric] [dev device]
route of address


To add a static route for an entire network using the add option is devine and the network-manager. For example:
route add-net 192.168.0.0 netmask 255.255.255.0 gw 10.0.0.254
Adds a static route for network 192.168.0.0/24 using as a gateway 10.0.0.254.

To set the default gateway you can type something like:
route add-net 0.0.0.0 netmask 0.0.0.0 gw 10.0.0.1 or:
route add default gw 10.0.0.1

To delete an existing route can be done by stating the name of the network:
route del-net 192.168.0.0

To view the route table enough route, if you want to avoid the reverse lookup of the IP and speed up the write operation:

route-n

To view the cache of the system used on the route:

route-C

Published in: linux, scripts, shell, tips

Comments are closed.

Powered by CyberTek - Remote Assistance