Barbed wire, which he had, and electric fences are really only effective against an intruder that feels pain. Zombies will just eventually knock them over under their mass and walk through.
Never mind the massive amount of constant juice needed , extensive wiring and maintenance necessary to make it even remotely effective.
Having installed a few hundred feet of fence I can tell you that a fence the size you are talkIng about would have taken them years to build just to get overrun anyway.
His power comes from an ancient looking gas/diesel generator. It was shown in episode 1 or 2 the same episode where Darryl takes the horse without asking and Rick goes to apologize. Herschel is pouring fuel into it as they speak.
(thumbs u