route– to show kernel routing table and to add/delete static route in linux

Routing table is saved in /proc/net/route file (for IPv4)

Possible options:

  • -n : show numeric address
  • del: delete a route
  • add: add a route
  • -net : destination address is a network
  • -host: destination address is a host
  • netmask: to provide network mask.
  • Metric M : to set metric
  • gw <address>: to set the gateway for a destination
  • reject : to  install blocking route
  • dev <if> : to specify the interface
  • -V or –version : to check installed ‘route’ version


route add -net netmask gw dev eth0

route add default gw

route –n : to display routing table

Flags: U – up, H-host, G-using gateway, ! – reject route

This entry was posted in Linux and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s