How to use the route command in Linux?

Installation of route command:

# in case of ubuntu/debian distribution
$ apt-get install net-tools
# in case of redhat distribution
$ yum install net-tools

Working with route:

  • To show IP/kernel routing table:
$ route
  • To add a new route to routing table:
$ route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
$ man route
  • To delete a route:
$ route del default

Task Description:

Steps:

  • Let’s check first that these 3 systems can ping to each other or not…
  • Now let’s modify the routing table of system B so that it can't ping to system C
$ route add -host 192.168.43.136 reject
  • Now modify the routing table of system C so that it can’t ping to system B
$ route add -host 192.168.43.176 reject

TASK DONE!!

Feel free to connect on linkedin…😊

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store