The high-frequency sonar fence was a continuous stream of high-intensity sound waves generated by a series of evenly-spaced pylons surrounding the Barracks. It was built by the DHARMA Initiative. ("LaFleur-Enhanced") The range of the waves reached only as high as the top of the pylons. ("Par Avion") With the potential to render someone walking through the fence unconcious, or even killing them, the waves could cause severe cerebral hemorrhaging to humans who passed through them. Although humans could physically breach the barrier before the sonic waves triggered side effects, the Man in Black could not pass between the pylons or overcome them while the fence was active. ("Left Behind") ("The Package")
On the Main Island
Mentions and encounters
The sonar fence was first mentioned in the DHARMA Initiative Barracks video, seen by Ben Linus when he first arrived on the Island. The film described the fence as serving to protect the Barracks area from the Island's abundant wildlife. Ben encountered the sonic barrier as a child, while running out of his home. He later obtained the code to deactivate the sonic barrier and, as a test, sent a rabbit through the barrier before crossing it himself. ("The Man Behind the Curtain")
Kate, Locke, Sayid, and Rousseau encountered the sonar fence on their mission to rescue Jack. According to Mikhail Bakunin, their prisoner, and the DHARMA cabling map discovered by Sayid in the Flame, the fence extended all the way around the area containing the Barracks. ("Par Avion")
Locke appeared to kill Mikhail by shoving him through the barrier. ("Par Avion"). After passing through it, he began shaking violently, foaming at the mouth and bleeding from the ears. He collapsed on the ground and appeared to have died. However, Mikhail did actually survive, and later helped save Naomi after encountering Desmond and the others who were attempting to find her. ("D.O.C.") After he returned to the Others' camp, Ben commented, "I thought you were dead." Mikhail responded, "I am fortunate the pylons were not set to a lethal level." ("The Man Behind the Curtain")
After seeing what happened to Mikhail, Locke, Kate, Sayid, and Rousseau made a ramp out of a tree trunk in order to scale the barrier and bypass it. In doing so, they did not break the connection between each barrier pylon, which Sayid guessed was the trigger for the sonic waves. ("Par Avion")
As shown by Ben in his flashback, the barrier could be deactivated. Kate and Juliet encountered the inactive fence while running from the Monster. After crossing to the other side, Juliet entered the code 1623 into a data pad, and after lifting a panel and turning a knob, the fence was reactivated. The Man in Black (whilst in Smoke form) then attempted to attack the pair but was repelled by the sonar fence - which appeared to act as a physical barrier against the smoke. After the Monster retreated, Juliet explained, "We don't know what it is but we know it doesn't like our fences." ("Left Behind")
When a young Ben deactivated the fence, he used the code 54439. This code was changed every day according to the orientation film he and Roger watched upon arrival to the island. The fence intensity seemed to be controllable at a continuous scale going from red to green to black, where green was presumably a repelling but less harmful effect. ("The Man Behind the Curtain")
The fence was seen in excellent condition after the final skip in time of the Island. Juliet shouted for Daniel to immediately stop as he almost walked through it. Amy faked disabling the fence by using earplugs. Sawyer, Jin, Miles, Daniel, and Juliet walked through the fence, which rendered them unconscious. Richard Alpert managed to get past the fence, and claimed that his people could do so with ease. ("LaFleur")
Early warning system
The early warning system, created by the DHARMA Initiative, warned the residents of the Barracks via an automated telephone call that consisted of a woman's voice repeating "Code 14-J". The system was activated when a panic code was entered to disengage the sonar fence.
In the extended version of the Barracks video, new DHARMA members were instructed how to disarm the sonar fence. They also received an explanatory leaflet from Security.  "14-J" was their code for trespass of a Hostile on DHARMA Initiative territory, in violation of the truce. ("Namaste")
Alex activated the early warning system after being kidnapped by Martin Keamy and the mercenary team. ("Meet Kevin Johnson") Forced at gunpoint to deactivate the fence, she entered the panic code 1623, initiating the warning phone call at Ben's house in the Barracks. ("The Shape of Things to Come")
On Hydra Island
After the retrieval of Jin by Widmore's team, the Man in Black (in John Locke's form) tried to get him back, but he was unable to pass across the pylons due to the activation of the fence. In addition to the dock area, additional pylons had been set up in the meantime on a beach to block passage to the Ajira plane. ("The Package")
The latter were removed after the plane was rigged with C-4. The fence was temporarily deactivated by Sayid, in order to let Jack go to the cages and free his partners, while the Smoke Monster attacked Widmore's men who were responsible for watching them. ("The Candidate")
- Juliet mentioned "fences" in the plural possibly hinting of other similarly protected facilities on the Island. ("Left Behind")
- A notation near the top of the blast door map stated, "DHARMA Protocol- No stations past security barrier".
- In Season 1, a fence can be seen in the distance. It is likely a real fence in Hawaii that was accidentally filmed. ("The Moth")
- There were keypads or control panels on both sides of the fence. ("The Man Behind the Curtain")
- A deleted scene from "The Economist" involved Miles, without any apparent knowledge of the sonar fence, correctly detecting that the fence was inactive.
- One way to bypass the fence was by taking the tunnels underneath the Barracks. Another was to climb directly over the top of the pylons. ("Par Avion") ("Follow the Leader")
- The sonar fence was one of the landmarks visible when the Island appears underwater in the flash-sideways timeline. ("LA X, Parts 1 & 2")
- For fan theories about these unanswered questions, see: Sonar fence/Theories
- Why is the Man in Black unable to go through the fence?
- Why couldn't the Man in Black simply fly over the fence in his smoke form?