routing command in linux

Linuxtopic
0


       Route manipulates the kernels IP routing tables.  Its primary use  is  to
       set  up static routes to specific hosts or networks via an interface after
       it has been configured with the ifconfig  program.



Add Route :

# route  add -net  < network >  netmask <subnet/netmask> gw  < gateway>

Ex - route add -net 10.20.3.0 netmask 255.255.255.0 gw 10.20.2.1

OR

# route  add -net  < network >  netmask <subnet/netmask> gw  < gateway>  <device>

Ex - route add -net 10.20.3.0 netmask 255.255.255.0 gw 10.20.2.1 eth1


Delete  Route :

# route  del -net  < network >  netmask <subnet/netmask> gw  < gateway>

Ex - route del -net 10.20.3.0 netmask 255.255.255.0 gw 10.20.2.1

OR

# route  del -net  < network >  netmask <subnet/netmask> gw  < gateway> <device>

Ex - route del -net 10.20.3.0 netmask 255.255.255.0 gw 10.20.2.1 eth1



Post a Comment

0Comments

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Ok, Go it!