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

Astaro v8.300 and Amazon VPC

Hi all.

I'm just trying to make a site-to-site VPN between Amazon VPC and a virtual machine running Astaro v8.300.
I've already created my VPC but when I try to import Amazon configuration it saya "No VPC connection found for local system".

I'm realyzing if the problem is my WAN interface, cause it's behind a NAT.

Did someone face that trouble?

Thanks in advice.
sorry my english.


This thread was automatically locked due to age.
  • Yeah man. Read all about it in this thread:
    https://community.sophos.com/products/unified-threat-management/astaroorg/f/58/t/54446

    I'm not using the Amazon VPC configuration, but at least you should read this in case the "behind that NAT" issues are also causing your problems.
  • Just for the next one to ask this question... the Customer Gateway address at Amazon VPC must be static and can't be behind a device performing network address translation (NAT).
  • You are saying that the Astaro can't be behind a NAT or the Amazon VPC won't work?

    If so, that is due to the Astaro's web GUI not allowing you to define your own IP that it will advertise with in the VPN connection. This is possible using the software Astaro is using for the VPN.
  • Hi Coewar,

    You are saying that the Astaro can't be behind a NAT or the Amazon VPC won't work?
    If so, that is due to the Astaro's web GUI not allowing you to define  your own IP that it will advertise with in the VPN connection. This is  possible using the software Astaro is using for the VPN.


    That's incorrect: Amazon has their own set of restrictions, in order to make a hardware VPN tunnel to VPC, you must have at your side a static IP address and not be behind NAT. Nothing we can do about that at this time, as it's not our limitation.
  • I disagree. I don't know about Amazon's "hardware" requirement, but of all the IPSec site-to-site connection's I've done, you can do it with any router capable in any part of a network. We have several business partners and some of them have their routers behind a NAT. (I have a whole thread on this topic here.) Also I have created my own Amazon linux routers and hooked them up together as well as to the Cisco and Astaro routers plus multiple Amazon Astaro routers, and all over the place for testing.

    As it turns out, in Linux (using the myid and leftid settings) you can set whatever IP you want as the advertised IP. On the other side, whatever router just uses the Public IP as the right setting. Because you ought to be able to put your router wherever you need to behind a NAT. This is for OpenSWAN and StrongSWAN at least.

    Astaro believe it or not, CAN work this way and I've proven it. I went into the ipsec.conf file (the defaults file actually) and forced it to have those settings and from the Amazon cloud it advertised using the Public IP I specified. Then I had to also change how the ipsec.secret file is written and use the IP I want rather than the private IP of the device. However the Web GUI in Astaro does not let you set these settings. So I added a feature request for it, and turns out, there are others too asking for it.

    Now, a separate thing that Astaro is not doing that causes more confusion, is that when the other side's router is behind a NAT and it is working as "normal" and advertising its own private IP instead of the public IP, Astaro is not able to connect unless you specify that remote router's private IP in the VPNID section of Astaro's Remote Gateway configuration.

    If I'm working with a Cisco router, and the remote is the same one behind a NAT, somehow Cisco automatically knows and uses instead of "IPsec" protocol, it uses one that it calls "IPSecOverNatT"

    You'd think that enabling NAT-T would fix this but it does nothing it seems for this.
  • And I think I'm close to proving that you CAN create a site-to-site VPN connection between Amazon VPC, and an Astaro device behind a NAT! This one I'm testing with is actually somewhere else in the Amazon cloud.

    In VPC I specify the Astaro's public IP Amazon gave it. Then I download the config file for that VPN connection which turns out is a very nice XML file. I edit the file and replace the parts that had the public IP with the Astaro's private IP because for some silly reason, Astaro's import process decides to not import unless the IP's match up. [:)] More work to code that for unnecessary reason.

    After importing, under the hood the ipsec.conf file now has a section like this:

    # vpn-xyz [1]
    conn S_REF_IpsAmaVpnxyz_0
            authby="psk"
            auto="start"
            compress="no"
            dev="vpc0.0"
            ecn="no"
            esp="aes128-sha1"
            ike="aes128-sha1-modp1024"
            ikelifetime="28800"
            keyexchange="ike"
            keylife="3600"
            left="yyyyyy"
            leftsubnet="0.0.0.0/0"
            leftupdown="/bin/sh -c true"
            pfs="yes"
            pfsgroup="modp1024"
            pmtu_discovery="no"
            rekeymargin="540"
            right="***x"
            rightid="***xx"
            rightsubnet="0.0.0.0/0"
            type="tunnel"

    guess what..  I think if I just add the leftid  and put my public IP tha tI used with Amazon's VPC, I bet I'll be connected! Let's see what happens..

    EDIT:
    Well it still is not working with Amazon's VPC with this error:
    ERROR: "S_vpn-xyz [1]" #2: sendto on eth0 to ***x:500 failed in main_outI1. Errno 1: Operation not permitted

    but I'm not going to take more time into making this work.

    Nonetheless, Astaro can be made to work behind a NAT and advertise its internet public IP with the leftid ipsec.conf setting.
  • unfortunately Amazon VPC does not work behind a NAT. But, I'll try to make a site-to-site VPN without VPC.
  • So, I got it!

    I finally close the site-to-site VPN between Amazon VPC and my local network using Astaro.
    I got it with Vyatta too.

    Step-by-step small guide:

    - Make a VPC (10.0.0.0/16) with public (10.0.0.0/24) and private (10.0.1.0/24) subnets;
    - Launch an Astaro Instance inside VPC in public subnet;
      This instance could be at Default Security group.
    - Open all ports or the ports you want in default security group (or the security group you've created to the Astaro Instance).
    - Configure the NAT Service at Astaro (I really didn't try it in Astaro but Vyatta)
    - Disable Source/Destination check for the Astaro Instance;
    - Remove the 0.0.0.0/0 entry at Main Route in the Route Table;
    - Add the 0.0.0.0/0 route through Astaro at Main Route in the Route Table;
    - Create a site-to-site VPN to the main network (in this guide 10.0.0.0/16)
    - Add an entry to your local network IP through Astaro at the main and secondary routes in the Route Table;
    - Create instances in the public or private network.
    - Open the ports you want at the existents Security Groups.

    So... If you want I could explain better. Sorry my poor english.
    To my friends in Brazil, I'll pasta this guide in portuguese:

    - Criar VPC (10.0.0.0/16) com rede privada (10.0.1.0/24) e pública (10.0.0.0/24)
    - Criar instância do Vyatta
    - Adicionar liberação no Security Group usado pela VM do Vyatta
    - Configurar serviço NAT para a toda rede na VM do Vyatta
    - Desabilitar a checagem de Source/Destination
    - Remover a entrada 0.0.0.0/0 na Rota principal da VPC
    - Adicionar a entrada 0.0.0.0/0 saindo pela VM do Vyatta na Rota Principal da VPC
    - Criar a VPN site-to-site para a rede da VPC (10.0.0.0/16)
    - Adicionar a entrada do ip da outra ponta da vpn na Rota principal saindo pela VM Vyatta
    - Adicionar a entrada do ip da outra ponta da vpn na Rota secundária saindo pela VM Vyatta
    - Criar instâncias e adicionar na rede pública ou privada
    - Liberar as portas específicas nos Security Groups existentes

    valeu!
  • Sounds cool. Question.. what did you mean by this statement? Is it something in Astaro, or some configuration in VPC?

    - Disable Source/Destination check for the Astaro Instance;


    And what did you configure the NAT to do?

    - Configure the NAT Service at Astaro (I really didn't try it in Astaro but Vyatta)


    In your router that was not in the VPC...  was it able to figure out that Astaro was behind a NAT? Or did you either configure its private IP in your non-VPC router, or hack Astaro to advertise the public IP?