To reduce potential accident risks and unnecessary time wasting, passenger flow control measures have been widely adopted for metro lines with oversaturated passenger flow. This paper proposes an integer linear programming (ILP) formulation for the optimal coordination of a passenger-oriented flow control strategy in a metro network during peak hours. The objective function of our formulation minimizes the total passenger waiting time at all stations under the premise of guaranteeing safety inside transfer stations. Our ILP formulation simultaneously considers the time-dependent passenger demand, destinations of the boarding passengers, transfer processes and train loading capacity constraints on lines in a metro network. Based on an upper bound on the number of waiting passengers at each station, a linear dynamic proportional method for assigning destinations for the boarding passengers is derived. Moreover, the method maintains the fast convergence of our ILP formulation and lets the formulation support real-time decision-making. Finally, a real-world instance with operation data of the Beijing metro system is implemented to demonstrate the accurate control ability to passenger flow of the proposed approach. As a result, the formulation obtains a solution with a total passenger waiting time of 57,488 min at transfer stations, which is 6698 min less than the value that is obtained with the previously established passenger flow control scheme.