Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Network Troublshooting => General Networking Support in Linux => Topic started by: modi on February 09, 2008, 06:46:45 PM

Title: crontab using for gateway change after every 10 minutes
Post by: modi on February 09, 2008, 06:46:45 PM
Hi!
Ricky

Long ago i get too much help from you about squid left this forum as i left the field
Again now my son have Q 

Redhat 9 

what is the way to use crontab
For

change gatway router after every five minutes autometically

not by manual command

route add 0.0.0.0 mask 0.0.0.0 192.168.1.2

after five minutes  CRON change it to

route add 0.0.0.0 mask 0.0.0.0 192.168.1.3

thanks for help


Title: Re: crontab using for gateway change after every 10 minutes
Post by: Ricky on February 10, 2008, 08:22:03 PM
So you need to run that command
Add two entries in your cron !
Code: [Select]
0,10,20,30,40,50     *    *    *   *    route add 0.0.0.0 mask 0.0.0.0 192.168.1.2   >> /dev/null 2>&1

Another one :
Code: [Select]
5, 15, 25, 35, 45, 55     *    *    *   *    route add 0.0.0.0 mask 0.0.0.0 192.168.1.3  >> /dev/null 2>&1
That way.. it will change gateway every five minutes.