Establishment of the barrier between the blood and the brain. The cells in the brain are packed tightly together preventing the passage of most molecules from the blood into the brain. Only lipid soluble molecules or those that are actively transported can pass through the blood-brain barrier.