el930692
asked on
How do I restart a Cisco VPN client automatically under Linux?
I have a cisco vpn client on a Cent OS 4.4 and want to make sure it comes back up automatically in case the connection goes down on the other side of the VPN tunnel.
I tried to add a cron job like:
This didn't work.
I see a couple of processes related to the vpn client:
Thank you!
I tried to add a cron job like:
* * * * * vpnclient connect MyConnection
This didn't work.
I see a couple of processes related to the vpn client:
root 13299 0.0 0.0 2672 1136 pts/4 S+ 23:34 0:00 vpnclient
root 13300 0.0 0.0 3744 916 ? Ss 23:34 0:00 cvpnd
nobody 13301 0.0 0.0 4008 1708 ? S 23:34 0:00 cvpnd
How can I turn the vpnclient into a daemon? I think this might be the solution but I'm not sure.Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you expert1010.
I already have your solution implemented. It's just not very clear to me what happens if the connection goes down. Is it trying to reconnect as a service in the background or on the shell since that's how I currently initiate the connection?
How would I test it to see is this setting does it it supposed to do?
That's why I wanted to implement my cron job since I know how a little more how that supposed to behave.
I already have your solution implemented. It's just not very clear to me what happens if the connection goes down. Is it trying to reconnect as a service in the background or on the shell since that's how I currently initiate the connection?
How would I test it to see is this setting does it it supposed to do?
That's why I wanted to implement my cron job since I know how a little more how that supposed to behave.
ASKER
I found out that I need something like this in the cron job:
*/5 * * * * /etc/init.d/vpnclient_init start
I set AutoInitiationRetryInterva l=2 in the .ini file and as a backup the cron jon above.
So if the VPN client will try to bring the connection back up every two minutes and just to make sure the cron job it will try to bring the connection up every 5 minutes.
*/5 * * * * /etc/init.d/vpnclient_init
I set AutoInitiationRetryInterva
So if the VPN client will try to bring the connection back up every two minutes and just to make sure the cron job it will try to bring the connection up every 5 minutes.
ASKER