We have moved at community.getvera.com

Author Topic: Setup VPN to Reach SQ Blaster  (Read 5836 times)

Offline tt55du

  • Full Member
  • ***
  • Posts: 211
  • Karma: +0/-0
Setup VPN to Reach SQ Blaster
« on: March 28, 2012, 11:17:41 am »
No Luck so far in forum searches, Is there a recommended vpn solution that other users have in place to connect there iDevice to your home network?

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Setup VPN to Reach SQ Blaster
« Reply #1 on: March 28, 2012, 11:27:30 am »
Does it have to be vpn? You still have ssh access correct? Is using ssh with port forwarding out of the question?

- Garrett

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: Setup VPN to Reach SQ Blaster
« Reply #2 on: March 28, 2012, 12:08:25 pm »
Does your router support VPN's? If not then you could look to see if there's a compatible DD-WRT or Open-WRT flash for it, or replace with something that has VPN functionality already.
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline tt55du

  • Full Member
  • ***
  • Posts: 211
  • Karma: +0/-0
Re: Setup VPN to Reach SQ Blaster
« Reply #3 on: March 28, 2012, 01:47:10 pm »
I use my vera 1 as my router so I'm at the mercy of openwrt kamikaze

@Garrett, I could use ssh, but it's a bit of a pain to login and configure SQ when I'm away from home and then reverse the config when I get home.  Also I hate that issh does not do dynamic tunnels (otherwise, it's a fine ssh client)

@strangely, I'm pretty close to getting a new router and pushing the vera behind it, but the vera is serviceable for now, so I'm a little reluctant to replace it, I was considering pptpd or l2tpd/ipsec for native access on an iDevice/Android.  Not sure if encryption is really necessary with l2tp ipsec or a strong password is enough with pptp.  I'm pretty clueless with actual setup so I was fishing for success that others may have had.  Also, the ipkg packages available for these are slightly dated so I may have to compile my own or make due with old versions.  I tried using the x-wrt in advanced settings and the VPN section does not work. 

I was also considering getting a pogoplug and pass vpn requests to it.  My Qnap NAS also supports openvpn and pptp, but it's not always on.  Ideally I would like to make it work on the vera.

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: Setup VPN to Reach SQ Blaster
« Reply #4 on: March 29, 2012, 02:35:50 am »
I was actually trying to set up a VPN myself last week using a a spare ASUS 520 GS router I had lying around that I loaded up with a version of DD-WRT that support VPN, (OpenVPN, PPTP and L2TP/IPsec), however work has been a bear for me the last couple weeks, and I haven't really had much time to get it running yet, and didn't have much success with it running behind my other router.

It'll be one of those things that sits on the back burner for a while I guess until I get some time, but I'm almost tempted to do a bit of a restructure with my network in general, and rethink a few things like having my front main router with it nativity supported, without having any nasty double NAT or port forwarding to it etc to save all the trial and error.

I was actually looking at the following to replace my router (or something similar), as I also need a bunch of extra switch ports, and the price seems pretty reasonable I think:

http://www.amazon.com/gp/product/B002JTXA4I/ref=s9_simh_gw_p147_d6_g147_i1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-3&pf_rd_r=1D3N8X729S49BR74WFSE&pf_rd_t=101&pf_rd_p=470938811&pf_rd_i=507846

One of the other considerations I've started to look at, is routing throughput, as I currently get nearly 50Mbit from my cable provider, and a lot of low end routers will bottle neck this, even without using a VPN!
« Last Edit: March 29, 2012, 02:42:24 am by strangely »
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Setup VPN to Reach SQ Blaster
« Reply #5 on: March 29, 2012, 06:09:14 am »
I'm running VPN on DD-WRT on my main router. Connecting to it with the built-in VPN option in iOS devices. Straightforward, as far as I remember.
Dezwaved at the moment...

Offline SquareConnectMat

  • Moderator
  • Full Member
  • *****
  • Posts: 248
  • Karma: +0/-0
Re: Setup VPN to Reach SQ Blaster
« Reply #6 on: March 31, 2012, 02:15:52 pm »
I use a Linksys RV016 - it is very old (8years?) but still works very well. I use the PPTP vpn option and it works well from iDevices, macs and Windows.

They are pricy though - around $350 new. The main reason for using it is that I have two differnet ISP's coming into my home and it does automatic fail over.

Typically, people seem to use remote access to vera and then have vera command SQBlaster using the @Guessed blaster plug in.

Later in the year, we will be enabling secure remote access to SQ Blasters (the new Plus and Gen 1 'puck') via an optional firmware upgrade that wont need a VPN, but will go to the blaster via an XMPP server (SQ's or one of several pubpic messaging systems).

Mat

Offline tt55du

  • Full Member
  • ***
  • Posts: 211
  • Karma: +0/-0
Re: Setup VPN to Reach SQ Blaster
« Reply #7 on: April 23, 2012, 01:02:15 pm »
Had some time this weekend due to the Nor'Easter

I was hesitant to use PPTPD because of inherent security risks, but I ultimately decided to go for it and mitigate the risk with extra long passwords and to write a script to shut it down and start it through a scene control.

I went and installed all the packages and got the service to start, but it doesn't work,  it looks like the kernel is out of date.  I tried all the kernel mods with no luck.  I'm a little hesitant to tinker too much more and risk bricking the vera.  If I don't get this to work, I may have to succumb and get a new dedicated router.

Mat, I have not used guessed's plugin.  Seems like a lot of work to get it setup and I'm concerned about support with vera1 since he seems very involved with it's development.  Latency seems like it might be another issue, but it should be ok for "all off" type scenes. I am intrigued with the XMPP server you guys are planning though.

Offline taftek

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Setup VPN to Reach SQ Blaster
« Reply #8 on: April 25, 2012, 04:40:02 am »
Im on draytek 2850vn vpn works perfectly with vera ui5 and sqblaster plus,works faster than acccess through mios.com almost like local connection

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: Setup VPN to Reach SQ Blaster
« Reply #9 on: April 25, 2012, 12:38:47 pm »
I just updated my router with a Asus RT-N16 which was extremely easy to install DD-WRT on compared to another outdated router I own, and now also have OpenVPN and a PPTP VPN setup. Total out of pocket expense after a $10 rebate was about $75
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline tt55du

  • Full Member
  • ***
  • Posts: 211
  • Karma: +0/-0
Re: Setup VPN to Reach SQ Blaster
« Reply #10 on: April 26, 2012, 03:42:44 pm »
Looks like my vera1 still has legs!
I finally got pptpd installed on my vera 1 and working after a bunch more kernel mods and firewall tweaking and it's actually working really good.
Safari is working and it shows my ip as the WAN ip and I'm hitting web pages just fine.  I'm also reaching local devices on the LAN just fine too (e.g. IP thermostat, IP Alarm, NAS box)

but ...  there's always a BUT.

when I initiate the vpn and fire up SQ, the blaster connects just fine but mios does not connect
btw, my blaster is assigned a static IP
So I go into MIOS System and Devices configuration
And it says there's a connection error dialog, I then press ok

It shows my IP address as  the correct WAN IP Address.

So I can make this work a couple ways:
I type in the LAN IP address of vera (Which is a Pain)
or
I switch the "Always Connect Using Remote Access" to On from a Default of Off (will increase latency unnecessarily, e.g. when I'm home)
This is also the case when I'm on a different wi-fi e.g. work, to get mios to connect I have to switch on "Always Connect Using Remote Access"

Any Ideas?

It works just fine when I'm physically home and on my local Wi-Fi and switches fine when I leave the house and use 3G (for mios, puck fails without VPN)

What's weird is that the puck is working just fine under vpn
and SQ accepts my mios credentials just fine as well

I'm guessing this might be a firewall issue since when I fired up the Sonos app with VPN I couldn't see anything either

I read in a post from Mat that bonjour might be an issue across different APs, wonder if this is related

Offline rlmalisz

  • Sr. Member
  • ****
  • Posts: 400
  • Karma: +1/-0
Re: Setup VPN to Reach SQ Blaster
« Reply #11 on: April 26, 2012, 05:32:49 pm »
Bonjour + VPN usually equals disappointment.  There are supposed to be two ways that Bonjour gets advertised to clients: multicast (224.0.0.251:5353) and DNS-SD.  Multicast is not routable, since it's layer 2 and not layer 3.  But it is bridgeable, but there are no bridged VPN clients for most handhelds.  You can beat your brains out setting up a Bind server to handle DNS-SD advertisement, but it seems that a lot of client app folks have been lazy and don't actually respect/utilize that part of the spec.  I have some time off coming up in a couple months, and am probably going to flatten my forehead against this some more.

--Richard

Offline SquareConnectMat

  • Moderator
  • Full Member
  • *****
  • Posts: 248
  • Karma: +0/-0
Re: Setup VPN to Reach SQ Blaster
« Reply #12 on: April 26, 2012, 08:18:41 pm »
A couple of points.

1) SQRemote only uses Bonjour to find SQBlasters.
2) I dont recommend using the Blaster setup to assign a static IP address (in the SQ Blaster setup wizard). If you want to assign an IP address that stays constant, then use your router in the DHCP options to always give the same IP address to the Blasters MAC address.
3) That IP address should then be addressable via the VPN and via local. It wont be addressable if you are remote and not on the VPN.
4) THe Vera discovery service uses the *external* IP address of the client device to identify which devices are locally available I.e. each vera on a netwrok makes a call to the mios service that registers that vera for that external address and the client device calls ther service and that service matches the IP addresses. When we look fro vera's locally, that is what we use to find them. I wouldn't mind betting that when you are on the VPN, that call goes out on the 3G Netowrk's IP address, and so doesn't find your vera.

As I mentioned in another post, by the end of the year (fingers crossed), we will have an optional firmware upgrade for the blaster and SQRemote that will, foir the blaster anyway, allow you to safely and securely access it it seamlessly from outside your home network as well as from inside.




Offline tt55du

  • Full Member
  • ***
  • Posts: 211
  • Karma: +0/-0
Re: Setup VPN to Reach SQ Blaster
« Reply #13 on: April 26, 2012, 10:52:15 pm »
Matt,

Thanks for the insight.

1.  Ok, so SQ Remote only uses bonjour for the blaster, noted
2.  I agree, and I do use mac filtering to assign all ip addresses including my blaster
3.  And I have no problem addressing the blaster when on vpn
4.  This is where I'm stumped.
With default configurations:
a. If I'm at home local wifi, iphone works great, picks up vera and blaster over local wifi
b. If I'm on 3g only, mios redirects just fine and I can't get to blaster (of course)
c. If at any other wi-fi AP, sq remote can't find vera until i turn "Always Connect Using Remote Access" and that doesn't always work, sometimes I get a wrong username/password when I know the username password is right; and I also can't get to blaster in this configuration (of course)
d. Outside of my home wi-fi using any other Wi-Fi AP or 3G and using VPN.  SQ Remote cannot find vera until I set the IP address to the internal .1 address of my vera.  I can also keep the WAN address and turn "Always Connect Using Remote Access" and that doesn't always work, sometimes I get a wrong username/password when I know the username password is right.  I Have no issues connecting to the sqblaster when on the VPN

I'm still leaning towards this to be a firewall issue on my side, theoretically the VPN gives the iphone an IP address in the same subnet as vera so the iphone should work as if were a native device on the LAN, correct?  I also have no problems connecting to the web interface of vera using the .1 address for both the standard vera web interface and the local smartphone interface.

Matt, when you say you "wouldn't mind betting that when you are on the VPN, that call goes out on the 3G Netowrk's IP address, and so doesn't find your vera."  Is that even possible? I'm not a networking expert by any means so please enlighten me.

Thanks,









Offline SquareConnectMat

  • Moderator
  • Full Member
  • *****
  • Posts: 248
  • Karma: +0/-0
Re: Setup VPN to Reach SQ Blaster
« Reply #14 on: April 27, 2012, 09:44:58 am »
c. If at any other wi-fi AP, sq remote can't find vera until i turn "Always Connect Using Remote Access" and that doesn't always work, sometimes I get a wrong username/password when I know the username password is right; and I also can't get to blaster in this configuration (of course)

I think there are two problems here.

One: I am not suire if this is eaxactly what you have setup, but it would seem likely that you have two or more wifi AP's set up as gateways and each one is connected to your cable/DSL modem. Vera is connected to either the main modem, or to one of the Access points. SQRemote is connected to the other access point.

 The Vera service discovery is not smart enough to detect this situation, so when SQRemote goes out to the Vera server, it has an external IP that it recognises, and returns to SQRemote an internal IP address to use to connect directly to Vera. However, that internal IP is the address of the 'other' access point or the main DSL or the address issued by that modem to Vera (I am not sure how vera sends its information to the service discovery and what it sends). the problem is that the network doesn't know how to route that address from SQRemote's access point so it wont work and will error out.

It could also be the 'double NAT' problem: To be even more confused, http://en.wikipedia.org/wiki/NAT explains the whole 'network address translation' issue, which is how the request from SQRemote and Vera get handled going out to the MiCasaVerde service in the cloud.

Two: SOmetimes not working. Most probably, there is a time out or multiple errors that are being reported back as User name password invalid. You might like to try increasing the timeout values in SQRemote for that Vera - although I can't remember if they are honored for login.

d. Outside of my home wi-fi using any other Wi-Fi AP or 3G and using VPN.  SQ Remote cannot find vera until I set the IP address to the internal .1 address of my vera.  I can also keep the WAN address and turn "Always Connect Using Remote Access" and that doesn't always work, sometimes I get a wrong username/password when I know the username password is right.  I Have no issues connecting to the sqblaster when on the VPN


When you put in a fixed address in SQRemote to Vera, we ignore all of the Service discovery methods and just connect directly. So in this case, when you are on the VPN, that IP address will be routed by iOS to vera via the VPN as it will recognise the first bit of the IP address as being for the VPN. Clearly the service discovery at this point is horribly confused and without looking at the actual network traces, I am not completely sure what is happening when you dont put in the vera address. On the 'Always connect remotely', my guess is timeouts and errors being reported as a failed login. It could be the Vera servers, or a section of network between them and you...

Mat