gateway – "No route to host" until "ping" or "route"

I have two computers in a WiFi network:

Sometimes (once in ten) after rebooting B, I can not go from A to B:

$ ssh
ssh: connect to the host port 22: no route to host

When I try to ping, I get:

$ ping
PING ( 56 (84) bytes of data.
From icmp_seq = 1 Destination Host Unreachable
From icmp_seq = 2 Destination Host Unreachable
From icmp_seq = 3 Destination Host Unreachable

ARP could be the problem:

$ arp
HWtype Address HWaddress Flags Mask Iface
gateway ether 70: 4c: a5: a7: c2: 57 C wlp2s0 (incomplete) wlp2s0

I was trying to fix it like this:

$ sudo arp -d
$ arping -c 10 -I wlp2s0
ARPING from wlp2s0
Sent 10 probes (10 broadcast (s))
Has 0 replies

no effect 🙁

I can not work around the problem by plugging the monitor and keyboard into B (server) and performing:

1) ping A (client)


2) typing "route" in the terminal

Then everything returns to normal.

An idea why this could happen?
My hypothesis is that B sometimes does not discover the gateway correctly. I am not able to check it because when I type "route" in the terminal B, everything returns to normal.

Notes from side:

  1. There is no firewall on B (server)
  2. One (client) is Ubuntu 18.04 Desktop
  3. B (server) is Ubuntu 16.04 minimal (maybe missing an important package for discovery arp / auto gw?)