How to use Route Command In Linux/Unix

The Route Command tool helps us display and manipulate the routing table in Linux. Information contained by this is about how network packets should be routed through a network.

Syntax:

route

route

This command shows destination, mask, flags, metric, gateway, reference count, and interface. We can also add or delete routes from a network with IP address.

For example: If we have “IP address: 192.168.90.0” and “Subnet mask = 24” and “gateway (gw) = 10.0.0.1”

Syntax:

route add -net 192.168.90.0/24 gw 10.0.0.1

Network configuration and troubleshooting commands in Linux

Computers are often connected to each other on a network. They send requests to each other in the form of packets that travel from the host to the destination. Linux provides various commands from network configuration and troubleshooting. 

Network Configuration and Troubleshooting Commands in Linux

  • Using Ping (Packet Internet Groper) Command
  • Using nslookup Command
  • Using traceroute Command
  • Using host Command
  • Using netstat Command
  • Using Arp Command
  • Using ifconfig Command
  • Using Dig Command
  • Using Route Command
  • Using Ethtool Command
  • Using Hostname Command

Similar Reads

Using Ping (Packet Internet Groper) Command

The ping command is used to ensure that a computer can communicate with a specified device over the network. The pings command sends Internet Control Message Protocol (ICMP) Echo Request messages in the form of packets to the destination computer and waits in order to get the response back. Once the packets are received by the destined computer, it starts sending the packets back. This command keeps executing until it is interrupted....

Using nslookup Command

The nslookup command queries the DNS in order to fetch the IP address or the domain name from DNS records....

Using traceroute Command

The traceroute command is used to get the route of a packet. In other words, the traceroute command is used to determine the path along which a packet travels. It also returns the number of hops taken by the packet to reach the destination. This command prints to the console a list of hosts through which the packet travels in order to the destination....

Using host Command

The host command is used to find a domain name associated with the IP address or find an IP address associated with the domain name. The returned IP address is either IPv4 or IPv6....

Using netstat Command

The netstat (Network Statistics) is the command that is used to display routing tables, connection information, the status of ports, etc. This command works with Linux Network Subsystem. This command basically displays the content of /proc/net file defined in the Linux file system....

Using Arp Command

The ARP (Address Resolution Protocol) command is used to display and modify ARP cache, which contains the mapping of IP address to MAC address. The system’s TCP/IP stack uses ARP in order to determine the MAC address associated with an IP address....

Using ifconfig Command

The ifconfig(Interface Configuration) is a utility in an operating system that is used to set or display the IP address and netmask of a network interface. It also provides commands to enable or disable an interface. Many UNIX-like operating systems initialize their network interfaces using ifconfig at boot time. ifconfig is also used to view the MTU(Maximum transmission unit)....

Using Dig Command

The Dig Command is called domain information groper; it is a tool used to find query information related to domain name and troubleshoot DNS issue in Linux. This tool can provide various types of DNS records, such as CNAME, MX records and records etc....

Using Route Command

The Route Command tool helps us display and manipulate the routing table in Linux. Information contained by this is about how network packets should be routed through a network....

Using Ethtool Command

The Ethtool is used to view and modify the settings of a network interface card (NIC) in Linux. It has replaced the old tool named mii-tool. This command can be used to view the current speed and duplex setting of the NIC. To view the settings for the NIC named “enp0s3” use the following command....

Using Hostname Command

The Hostname command is used to display the current hostname of the system....

Conclusion

Computer networks are essential for communication and data transfer between devices and in Linux we get various commands to configure and troubleshoot network-related issues. Commands that we have mentioned in the article are ping, nslookup, traceroute, host, netstat, ARP, Dig, Route, Ethtool, Hostname and ifconfig. With these commands one can fix network problems by diagnosing them....