View Single Post
Posts: 2 | Thanked: 1 time | Joined on Jul 2008
#22
Originally Posted by gochito View Post
mc-account set sip0 string:local-ip-address=10.x.x.x
Thank's for the tip. FYI, I've setup my openvpn network scripts to do this automatically for me. In my case, I only have one VPN connection, and only one SIP server I ever wish to talk to; as such, this may not be applicable to more complex setups.

/etc/network/if-up.d/openvpn:


#!/bin/sh

OPENVPN=/etc/init.d/openvpn

if [ ! -x $OPENVPN ]; then
exit 0
fi

if [ -n "$ICD_CONNECTION_ID" ]; then
$OPENVPN restart $IF_OPENVPN
sleep 5
VPN_INT="tun0"
VPN_IP=`ifconfig $VPN_INT 2> /dev/null | sed -n 's/.*inet[adr: ]*\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*/\1/p'`
mc-account set sip0 string:local-ip-address=$VPN_IP
fi


I'm using the /etc/network/if-down.d/openvpn script from http://www.internettablettalk.com/fo...ad.php?t=18434

NOTE: I'm using "restart" instead of "start" to avoid problems caused by two openvpn instances running (one started at boot, one started when the wlan interface comes up)
 

The Following User Says Thank You to jimhoy For This Useful Post: