And Laith said: Yunus narrated the hadith to me, from Ibn Shihab, he said that Salim narrated that
Hazrat Abdullah used to offer prayer upon his mount at night, and at that time he was a traveller, and he did not care which direction the mount's face was, and Hazrat Abdullah bin Umar said: The Messenger of Allāh ﷺ used to offer voluntary prayer upon his mount, whichever direction it faced, and he ﷺ used to offer Witr upon it, however, he ﷺ did not offer the obligatory prayer upon it.
وَقَالَ اللَّيْثُ حَدَّثَنِي يُونُسُ، عَنْ ابْنِ شِهَابٍ، قَالَ قَالَ سَالِمٌ
كَانَ عَبْدُ اللَّهِ بْنُ عُمَرَ رَضِيَ اللَّهُ عَنْهُمَا يُصَلِّي عَلَى دَابَّتِهِ مِنَ اللَّيْلِ، وَهُوَ مُسَافِرٌ مَا يُبَالِي حَيْثُ مَا كَانَ وَجْهُهُ قَالَ ابْنُ عُمَرَ وَكَانَ رَسُولُ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ يُسَبِّحُ عَلى الرَّاحِلَةِ قِبَلَ أَيِّ وَجْهٍ تَوَجَّهَ، وَيوتر عَلَيْهَا، غَيْرَ أَنَّهُ لاَ يُصَلِّي عَلَيهَا المَكْتُوبَةَ
Reference: Sahih Al Bukhari 1098