Sunan Ibn Majah, Volume 2, Book 6, Hadith 1478 (DarusSalam)

It was narrated that Abu ‘Ubaidah said: “ ‘Abdullah bin Mas’ud said: ‘Whoever follows a funeral (procession), let him carry all (four) corners of it (in turn), for that is Sunnah. Then if he wishes let him voluntarily carry it, and if he wishes let him not do so.’”

حَدَّثَنَا حُمَيْدُ بْنُ مَسْعَدَةَ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، عَنْ مَنْصُورٍ، عَنْ عُبَيْدِ بْنِ نِسْطَاسٍ، عَنْ أَبِي عُبَيْدَةَ، قَالَ قَالَ عَبْدُ اللَّهِ بْنُ مَسْعُودٍ مَنِ اتَّبَعَ جِنَازَةً فَلْيَحْمِلْ بِجِوَانِبِ السَّرِيرِ كُلِّهَا فَإِنَّهُ مِنَ السُّنَّةِ ثُمَّ إِنْ شَاءَ فَلْيَتَطَوَّعْ وَإِنْ شَاءَ فَلْيَدَعْ ‏.‏

sunnah.com