I am quoting the question and the answer posted at stackexchange:

2. Relevant equations

3. The attempt at a solution
I need some help in understanding the solution. The first post (answer) in that link finds out the number of configurations. Doesn't these configurations depend on the colour of the face which is just opposite to the red coloured face? I can't even understand the step the poster has done next.

I still don't get it, for example if I fix red and blue colour on the top and the bottom face respectively, I have 24 ways to colour the side walls but they are all same. Similarly I can go about fixing two other colours on both the sides i.e there are 6C2=15 ways to select two colours and 15 different ways to colour the six walls. But as stated above, the answer is 30, where am I wrong?

One of the face is coloured red. We are left with 5 colours now. We paint the side walls with 4 out of these 5 colours, let the colours on the side walls be green, blue, yellow and black. There are four same configurations. Let the 6th colour be white. Interchanging green with white, I get more 4 same configurations. Interchanging more colours, there are 20 same configurations for a single position of red.

No, you're counting (wrongly) the number of different colourings …

the position of the first colour (say, red) doesn't matter, then you have 5 choices for the opposite colour, the position of the third colour doesn't matter, and there are 6 ways of arrangeing the last three colours

total different ways = 5*6 = 30.

The stackexchange method was to count the number of orientations for the same colouring, result 24, and then divide 6! by 24 to get 30.