This is a PHP script that will automatically update the setup for a specific IPSEC VPN.
M0n0wall currently does not support an IPSEC tunnel where one or both ends are dynamic IP address. Along with the dynamic DNS service that is built into m0n0wall, this PHP script can let you setup an IPSEC tunnel between a static-dynamic or dynamic-dynamic ip address.
The PHP script checks to see if IP address of the dynamic DNS host name has changed from the last time it was checked. If the IP address is different, the PHP script will log the new IP address to a file. The script will then send an HTTP POST request to the m0n0wall web based IPSEC admin page to update the remote gateway's IP address. If this was successful, another POST request will be sent to apply the changes. The PHP script can be setup to run as a cron job to run every five minutes.
The IPSEC update script was tested with m0nwall 1.2, FreeBSD 6.2, Apache 2.2, and PHP 5.2. The minimum requirements are:
The easiest way to set this up is to get a FreeBSD or Windows machine and install PHP 5.2 as a CLI. These instructions assume that you are using FreeBSD 6.2 and that you already setup a dynamic DNS hostname for the m0n0wall(s) with the dynamic IP address.
rm ipsecUpdate.tgz
If your having trouble getting this to work, you can post a question in the web forums or submit a bug report or feature request at the Source Forge project page
The script can be downloaded from here.
