Plenty of borders around the world are peaceful, and there isn’t much “defending” going on. Those are maintained without much trouble.
If we narrow the discussion to borders that aren’t very peaceful, there aren’t many successful solutions. It looks like “nothing gets through” works, but “only approved traffic gets through” doesn’t work.