Using route command

The route command is also used to modify the routing table.

Following are the examples to illustrate the usage of route command:

  • Use the route command as shown here to display the current routing table:
$ route -n
  • The route command can also be used to add a static route in the routing table. The following route command syntax is used to add a network routing information in the routing table:
$ route add -net x.x.x.x/prefix dev <devname>
  • The following route command syntax is used to add a host routing information in the routing table:
$ route add -host x.x.x.x dev <devname>
  • The route command can also be used to delete a static route in the routing table. The following route command syntax is used to delete a network routing information in the routing table:
$ route del -net x.x.x.x/prefix dev <devname>
  • The following route command syntax is used to delete a host routing information in the routing table:
$ route del -host x.x.x.x dev <devname> 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.71.94