Skip to content

Instantly share code, notes, and snippets.

@dgershman
Created July 25, 2014 15:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgershman/fe4ec52bc1e124c89c6d to your computer and use it in GitHub Desktop.
Save dgershman/fe4ec52bc1e124c89c6d to your computer and use it in GitHub Desktop.
This fix patches up a Cisco VPN connection on OSX to not disconnect after 1 hour and instead 1 day.
sudo mkdir /etc/racoon/remote
sudo mv /var/run/racoon/*.conf /etc/racoon/remote
sudo sed -i.bak 's/lifetime time 3600 sec/lifetime time 168 hours/' /etc/racoon/remote/*.conf
sudo patch /etc/racoon/racoon.conf <<EOF
--- /etc/racoon.orig/racoon.conf 2009-06-23 09:09:08.000000000 +0200
+++ /etc/racoon/racoon.conf 2009-12-11 13:52:11.000000000 +0100
@@ -135,4 +135,5 @@
# by including all files matching /var/run/racoon/*.conf
# This line should be added at the end of the racoon.conf file
# so that settings such as timer values will be appropriately applied.
+include "/etc/racoon/remote/*.conf" ;
include "/var/run/racoon/*.conf" ;
EOF
sudo launchctl stop com.apple.racoon
sudo launchctl start com.apple.racoon
@dgershman
Copy link
Author

Download the raw file and save as patch_vpn.sh. Then run chmod +x patch_vpn.sh, and execute ./patch_vpn.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment