Score:2

IPsec connection established but client not able to reach host until host pings the client

as flag

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?

Score:1
mm flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.