Multispacecraft observations of energetic ions upstream and downstream of the bow shock