VPN and LAN connections
The base URL is set in civicrm.settings.php.

I can imagine you create a conditional statement in there.

You should try if $_SERVER['SERVER_ADDR] or $_SERVER['SERVER_NAME'] is the right variable for you to differentiate between the 2 situations.

More info:
http://php.net/manual/en/reserved.variables.server.php