How Do I Route in Linux?

How Do I Route in Linux?
Contents

Add route on Linux using ip. The easiest way to add a route on Linux is to use the “ip route add” command followed by the network address to be reached and the gateway to be used for this route. By default, if you don’t specify any network device, your first network card, your local loopback excluded, will be selected.

How do I run a route in Linux?

Working with route command

  1. To display the IP/kernel routing table. …
  2. To display routing table in full numeric form. …
  3. To add a default gateway. …
  4. To list kernel’s routing cache information. …
  5. To reject routing to a particular host or network. …
  6. To get details of the kernel/IP routing table using ip command.

What is Route command used for?

The route command allows you to make manual entries into the network routing tables. The route command distinguishes between routes to hosts and routes to networks by interpreting the network address of the Destination variable, which can be specified either by symbolic name or numeric address.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.