Active Topics

 



Notices


Reply
Thread Tools
Posts: 44 | Thanked: 5 times | Joined on Jul 2007
#11
Nope, still have to manually set the good ol' mc-account with the tun0 address ....
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#12
Are you trying to get built-in SIP client to talk through tun0?

I have done something like that with
Code:
redirect-gateway def1
up /etc/openvpn/domain.up
down /etc/openvpn/domain.down
redirect-gateway def1 directs all traffic though tun interface so up and down scritps are used to set nameservers.
 
Posts: 44 | Thanked: 5 times | Joined on Jul 2007
#13
I tried the redirect gateway a while ago and could not get the built-in client to connect to my Asterisk server when the openvpn was up... The only way that I could get it to work is with the mc-account set sip0 string:local-ip-address= $tun0_ip....
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#14
I was using only google talk, so there could be a difference. If you didn't set nameserver, that could also block sip?

With up script you can anyway run anything when openvpn connection starts
 
Posts: 44 | Thanked: 5 times | Joined on Jul 2007
#15
A while ago I reported bug 1860 in bugzilla... some of the nokia guys commented that the SIP stack is not currently aware of the tun0 interface going up/down, so the workaround that I found (here in the forums) was to manually assign the openvpn address to just the SIP account... Basically what I do is connect to the Openvpn server @ my office and log into my asterisk account with the N810 when out of the office... When I am @ the office i just log into the wlan and connect directly to Asterisk (192.168.x.x)... So I don't need to set the nameservers from the VPN connection...
 
Posts: 44 | Thanked: 5 times | Joined on Jul 2007
#16
Mikkov:

Now, do the if-up and if-down scripts execute when the tun0 goes up/down? I did some testing yesterday but did not get very far... A nice addition to your applet would be a pre/post-start and pre/post-stop scripts , since I am sure that many users need to do stuff before and after the vpn is up/down just related to the VPN tunnel :-)

Anyways, your applet removed a bunch of steps on setting up my SIP connection to the office...
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#17
Maybe there is slight misunderstanding.

Openvpn has up and down parameters which can run any command when tun device is opened and closed

--up cmd
Shell command to run after successful TUN/TAP device open (pre --user UID change). The up script is useful for specifying route commands which route IP traffic destined for private subnets which exist at the other end of the VPN connection into the tunnel.

--down cmd
Shell command to run after TUN/TAP device close (post --user UID change and/or --chroot ). Called with the same parameters and environmental variables as the --up option above.

Note that if you reduce privileges by using --user and/or --group, your --down script will also run at reduced privilege.
To me it looks like this is exactly what you want to do.
 
Posts: 44 | Thanked: 5 times | Joined on Jul 2007
#18
:-) Yeap, seems like there is... let me get into those and will comment on the results!
 
Posts: 44 | Thanked: 5 times | Joined on Jul 2007
#19
Great! using the up and down parameters from openvpn and borrowing from jimhoy's scripts, I was able to get it working !

Here are Jimhoy's scripts...

http://www.internettablettalk.com/fo...=rtcomm&page=3

I used this part for the up:

#!/bin/sh
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'`
if [ -n "$VPN_IP" ]; then
mc-account set sip0 string:local-ip-address=$VPN_IP
fi

And a similar one for the down !

Excellent!
 
Posts: 43 | Thanked: 2 times | Joined on Dec 2007
#20
Maybe a dumb question but where is the tun/tap device?

I imported a ovpn file that I use on my laptop. Both 'test' and connect appears to work. However, there does not appear to be a tun or tap 'device'. If I type 'ifconfig' there is only lo and wlan0. 'route' does not show anything new.

I am running the latest diablo. I do not see a tun.ko module either. (unless is is built into the kernel) Any ideas?
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:27.