Here's a bunker I built a few days ago, it has a dual layer design with sloped outer layer to allow grenades (if they aren't exploding to roll down). The outer layer has a medium sized opening which is large enough to shoot through from mid-close range but very hard to throw a grenade inside unless really close.
The second layer has an even smaller gap to shoot through making it extremely difficult for the machine gun to actually get a bullet through (the pistol can sometimes get lucky).
These images show a half finished bunker fairly sloppily made but you get the idea. If a well place grenade goes off on the outside you may sustain 10 points of damage. If a very well placed grenade gets inside the first layer, you just step back allow it to explode and continue raping.