“I asked Tawus about performing voluntary prayer while traveling. Al-Hasan bin Muslim bin Yannaq was sitting with him and he said: ‘Tawus told me that he heard Ibn ‘Abbas say: “The Messenger of Allah ﷺ enjoined prayer while a resident and prayer when one is traveling. We used to pray when we were residents both before and after (the obligatory prayer), and we used to pray both before and after (the obligatory prayer) when we were traveling.’”
أَنَّهُ سَمِعَ ابْنَ عَبَّاسٍ يَقُولُ فَرَضَ رَسُولُ اللَّهِ ﷺ صَلاَةَ الْحَضَرِ وَصَلاَةَ السَّفَرِ فَكُنَّا نُصَلِّي فِي الْحَضَرِ قَبْلَهَا وَبَعْدَهَا وَكُنَّا نُصَلِّي فِي السَّفَرِ قَبْلَهَا وَبَعْدَهَا