2

I am trying to establish IPsec connection between two linux machines residing in the same VPC but in different subnets. On both machine I have following configuration:

Host machine:

conn hostConn
    left=%any
    right=172.31.48.11
    authby=secret
    auto=start
    leftid=@client
    rightid=@host
    type=transport
    ikev2=insist
    keyexchange=ike
    ike=aes256-sha2_384;dh20
    esp=aes_gcm_c256

Client configutation:

conn clientConn
    left=%defaultroute
    right=172.31.48.11
    authby=secret
    auto=start
    leftid=@client
    rightid=@host
    type=transport
    ikev2=insist
    keyexchange=ike
    ike=aes256-sha2_384;dh20
    esp=aes_gcm_c256

When I ping from client machine it is failed but once I ping from host machine to client then both side ping becomes successful.

On both machines IPsec logs show that the connection is established but it needs that first ping from host to client to start communication between them over the IPsec connection.

Am I missing something? Any suggestion about how to debug this issue?

1 Answer 1

1

Two things I don't see in your config.

  • Add a default route for the network you want to reach on your VPN device. Without a route for the specific subnet of the host the VPN device will forward all traffic through the default gateway which is out to the Internet. Creating the VPN connection will not also generate the route in the routing table.

  • Look for an option to allow broadcast traffic across the VPN. Your client has no idea where the host is until it gets it's first message. Broadcast traffic can help with this but it's bad to forward broadcast traffic on slow or expensive connection which is why this is an option.

It's been a very long time since I had this issue with IPsec, but those are the two that are on the top of my head.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .