It was also very vulnerable to attacks from the rear. Surely enough it had a rear gunner but (from memory) it only had SHKAS light machine guns. It was the same issue as Lancaster 7.7 mm or the B-17 12.7 guns: very high rate of fire but the munition was too light and not explosive : unlike a 20 mm shell. The LW soon armored its 109s and FW-190s, also their pilots learned very quickly about wallies planes vulnerabilitiess (think of the B-17s shot in frontal attacks, and later with R4M rockets firing farther than the 12.7 guns could reach).
Out of 36 000 Il-2s manufactured, almost one-third were shot down (think 10 000 or even 11 000). A trully horrific lost rate. The Soviets however churned more Il-2s, faster than LW Expertens could shoot down...
en.wikipedia.org
There were also Mosquitos with a 57 mm and B-25 with a 75 mm gun. And probably others I forgot. Hurricanes with 40 mm anti-tank gun pods under wings.
-My understanding is that the above mentionned "contraptions" suffered from gun recoil, somewhat like the F-16s in GW1 that were supposed to replace A-10 with a centerline gun pod. Bad luck, recoil was so atrocious it shook the F-16 and blurred targetting.
-In stark contrast the Beech A-38 used the same trick as the A-10. To manage recoil better, they build the whole plane around the gun from the beginning. So that the plane itself - a few tons of metal - tamed the recoil.
-More generally, in WWII there was no easy solution to the basic issue of "demolishing a tank with an airplane." The belligerants tried all kind of different weapons - bombs, rockets, guns - on many different airframe: as diverse as a HS-129, a Breguet 693, a Stuka, a Fairey Battle, a P-47, a Beech A-38, an Il-2, a Typhoon with rockets, B-25 and A-26. None solution was entirely satisfying.
- Bombs and rockets tended to miss the tanks
- a large caliber gun could eventually demolish a tank if the shell hit. But that was the theory.
-Smaller guns (let's say, 20 mm to 30 mm) could fire quickly and de facto get more chance to land a shell right on the tank
BUT
that light shell might not be able to demolish the tank or at least knock it out.
-As for the larger guns ( from a P-39's 37 mm to a B-25's 75 mm) they just fired too slowly, compared to the plane high velocity. A good pilot could get its sight on the tank and fire, but the gun would only fire one shell in the meantime.
Thinking about it further, the problem of killing a tank from the air was ultimately solved by a) A-10 Whartog and b) AH-1 Cobra and all the other attack helicopters.
- A-10 was still very fast but got a big gun (30 mm) that could fire quick enough: the solution was called GATLING. 6000 rounds per minute, now that's talking seriously. 100 shells per second, that's plenty enough for a few of them to find the tank and demolish it.
-Helicopters could hover at zero velocity and from there, dump on the tank a) unguided rockets and later b) TOW guided missiles.