That's an almost impossible question to answer... it depends on the subject, the university, your educational attainment, your natural ability, your commitment to studying, etc etc.
In general it is doable with the right attitude, commitment, and hard work. It is certainly not a walk in the park but it is achievable for most as long as you put in A LOT of effort with your work.
Don't take it for granted that you will graduate with a 2:1 "because everyone does" because this is a surefire way for you to NOT graduate with a 2:1.... students put in a whole load of work to achieve this, a lot of which you don't always see from the outside.