Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Android to Astaro VPN

I have seen a couple of threads with people attempting and successfully getting a vpn connection between the Astaro Gateway and an Android phone. 

I have been trying to brute force my way through setting it up and I am coming up with nothing. Would someone be willing to share with me their L2TP Ipsec configuration so I can attempt to mimic it?

Upon achieving a successful connection I will immediately proclaim your brilliance to all of twitter. 

Thank you in advance for your assistance!


This thread was automatically locked due to age.
  • Ugh, I feel your pain.  PPTP is the only reliable connection I've been able to get working on my Evo so far.  I plan on rooting it and trying OpenVPN when the Spare Time Fairy visits me and I have a chance to play.  L2TP has never worked for me, either.

    BUT, I have to admit I have not spent a lot of time on it.
  • I have L2TP over IPSec with pre-shared key working very reliably with Android 2.2 HTC EVO 4G Sprint, ASG 8.1 home license. It worked with ASG 7.5 also and kept working after upgrade to 8.1. Please see the discussion here:

    https://community.sophos.com/products/unified-threat-management/astaroorg/f/58/t/53976

    After setting up VPN, I found that sometimes I have to power off/on the phone to make it work.
  • So I am getting somewhere, just not sure where yet. This is the configuration I am using. L2TP over IPSec on the WAN interface, Auth mode: X509 CA Check w/ Local X509 Cert selected. I am using IP Address pool with the pool network as the VPN Pool (L2TP). Under access control I have local authentication selected and added my local user. I have that user created in the users area and have a certificate called android that is set by IP address and I used the NAT'ed address that was showing up in the logs. 

    When I setup my Android to use L2TP over IPSec CRT/VPN specifying my user's cert and the VPN signing Cert in the connection. When I try to connect my phone sits for a while and then says it can't connect.  At that point if I look at my Remote Access tab it shows my vpn user as online. 

    TLDR - My phone says it can not connect, my Astaro v8.1 says it is connected. 

    to[6691]: packet from 174.253.6.147:31648: received Vendor ID payload [RFC 3947]
    2011:01:22-09:45:02 Hades pluto[6691]: packet from 174.253.6.147:31648: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-02]
    2011:01:22-09:45:02 Hades pluto[6691]: packet from 174.253.6.147:31648: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-02_n]
    2011:01:22-09:45:02 Hades pluto[6691]: packet from 174.253.6.147:31648: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-00]
    2011:01:22-09:45:02 Hades pluto[6691]: packet from 174.253.6.147:31648: ignoring Vendor ID payload [FRAGMENTATION 80000000]
    2011:01:22-09:45:02 Hades pluto[6691]: "D_REF_jtFeYppclD"[10] 174.253.6.147:31648 #16: responding to Main Mode from unknown peer 174.253.6.147:31648
    2011:01:22-09:45:03 Hades pluto[6691]: "D_REF_jtFeYppclD"[10] 174.253.6.147:31648 #16: NAT-Traversal: Result using RFC 3947: peer is NATed
    2011:01:22-09:45:05 Hades pluto[6691]: "D_REF_jtFeYppclD"[10] 174.253.6.147:31648 #16: Peer ID is ID_IPV4_ADDR: '10.226.229.241'
    2011:01:22-09:45:05 Hades pluto[6691]: "D_REF_jtFeYppclD"[10] 174.253.6.147:31648 #16: crl not found
    2011:01:22-09:45:05 Hades pluto[6691]: "D_REF_jtFeYppclD"[10] 174.253.6.147:31648 #16: certificate status unknown
    2011:01:22-09:45:05 Hades pluto[6691]: "D_REF_jtFeYppclD"[11] 174.253.6.147:31648 #16: deleting connection "D_REF_jtFeYppclD" instance with peer 174.253.6.147 {isakmp=#0/ipsec=#0}
    2011:01:22-09:45:05 Hades pluto[6691]: "D_REF_jtFeYppclD"[11] 174.253.6.147:31648 #16: we have a cert and are sending it
    2011:01:22-09:45:05 Hades pluto[6691]: | NAT-T: new mapping 174.253.6.147:31648/31665)
    2011:01:22-09:45:05 Hades pluto[6691]: "D_REF_jtFeYppclD"[11] 174.253.6.147:31665 #16: sent MR3, ISAKMP SA established
    2011:01:22-09:45:06 Hades pluto[6691]: "D_REF_jtFeYppclD"[11] 174.253.6.147:31665 #16: ignoring informational payload, type IPSEC_INITIAL_CONTACT
    2011:01:22-09:45:07 Hades pluto[6691]: "D_REF_jtFeYppclD"[3] 174.253.6.147:31665 #17: responding to Quick Mode
    2011:01:22-09:45:07 Hades pluto[6691]: id="2201" severity="info" sys="SecureNet" sub="vpn" event="Connection started" username="10.226.229.241" variant="ipsec" srcip="174.253.6.147" virtual_ip="174.253.6.147"
    2011:01:22-09:45:08 Hades pluto[6691]: "D_REF_jtFeYppclD"[3] 174.253.6.147:31665 #17: IPsec SA established {ESP=>0x0558fd28 
  • I was never able to get certificate based VPN working. I tried L2TP over IPSec with pre-shared key and it worked. I can post my setup for the VPN if you want to test it out.
  • That would be great. I just switched everything back to PSK and it didn't appear to get as far as my configuration with the Certs did. 

    Have you rooted your phone?  I saw that a lot of people have gone that route and were able to get VPN to work however I am not interested in rooting my phone to get this to work. I have a hard enough time trusting Google with access to everything I have let alone someone that created a custom rom to hack an android phone...

    Thanks.
  • I have not rooted my phone. Here is the setup:

    On ASG:
    Remote Access->L2TP over IPSec
    Interface: External (WAN)
    Authentication: Preshared key
    Preshared key: any PSK of your choice
    Repeat: repeat PSK

    Assign IP address: IP address pool
    Pool Network: VPN Pool (L2TP)

    Authentication via: Local
    User and Groups



    Network Security->NAT->Masquerading

    Network: VPN Pool (L2TP)
    Interface: External (WAN)
    Use address: >

    Enable the masquerading rule.

    Network Security->Packet Filter

    Source: VPN Pool (L2TP)
    Service: Any
    Destination: Internal (Network)
    Action: Allow
    Time Event: >

    Source: VPN Pool (L2TP)
    Service: Web Surfing
    Destination: Any
    Action: Allow
    Time Event: >

    Enable the packet filter rules.

    On the phone:
    VPN Name: Any name you choose

    Set VPN server: this the name which resolves to your public IP. I use dyndns for this purpose.

    Set IPSec pre-shared key: whatever key you chose on ASG

    Enable L2TP Secret: leave unchecked

    DNS search domains: not set

    Phone must be set to obtain IP address via DHCP. I observed that somehow VPN did not work with static IP assigned. I had to restart the phone after making all these settings. Hope this gets your VPN working.
  • Thanks for posting your config, I will try it out tonight. Did you make the following change to your Astaro? 

    Enable L2TP/PSK and add the line "require-mschap-v2" to the file /var/chroot-ipsec/etc/ppp/options.

    I found this in one of the message threads and I am not sure if it is still required. At this point, I do have it in my options file.
  • I still can't get this to work. My original configuration was close to the one that you posted, I had the masking and NATing set, I just referred to the source as the user I was using to VPN with. When the PSK didn't work, I tried the cert method and still got as far as I did before, which was the Astaro showing a connection through VPN but my phone saying it could not connect.
  • Yes, I had added that line to the file. I had added it when I was on 7.5 and I see that it is still there even after upgrading to 8.101. The date on this file is Jan-23-2011 which is when I had applied the 8.101 update. I am assuming that new file already has this line so it must be required .
  • I deleted the entire configuration from the phone and ASG and did it again as per my setup. It worked without any issue. I can't remember doing anything else. Maybe you can turn on debugging and check what the log says.