Route


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

Examples:

route add -net 1.1.1.0 netmask 255.255.255.0 gw 10.11.131.3 dev eth0

route add default gw 10.11.131.3

route –n : to display routing table

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

Advertisements
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:

WordPress.com Logo

You are commenting using your WordPress.com 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