100 yards. With auto-targeting 50 cal machine guns with overlapping fields of fire.
My preferred option is two walls at least half a mile apart, with a labyrinth laden with deadly traps in between. It would be modular so we could change the maze every week or two so people can’t learn the safe path through it.
Then, I’d leave the doors wide open on each side. Those who want to try to come over would be free to do so, but only a few of the cleverest and most physically fit would survive.