Considering the application of flocking control on connected and automated vehicle (CAV) systems, the persistent interactions between CAVs (flocking agents) and road boundaries (permanent obstacles) are critical due to flocking constraints in a strictly confined environment. However, the existing flocking theories attempt to model and animate natural flocks by considering temporary obstacles, which only describe interactions between agents and obstacles that would eventually disappear during flocking. This paper proposes a novel flocking control algorithm to extend existing flocking theories and guarantee the desired flocking coordination of multi-agent systems (e.g., CAV systems) with permanent obstacles (constraints). By analyzing comprehensive behaviors of flocks via Hamiltonian functions, a zero-sum obstacle condition is developed to ensure the satisfaction of permanent obstacle avoidance. Then, an additional control term representing the resultant forces of permanent obstacles is introduced to tackle interactions between agents and permanent obstacles. Demonstrated and compared through simulation results, a CAV system steered by the proposed flocking control protocol can successfully achieve the desired flocking behaviors with permanent obstacles avoidance in a three-lane traffic environment, which is failed by existing flocking control theories solely considering temporary obstacles.