A risk-based approach to control dangerous goods (DG) transport flows by roads is proposed, solving a real-time flow assignment problem. The model takes into account the planned scheduling of the DG fleets. The objective is to readapt the schedule in real time, controlling the DG flow to minimize both the risk on the network and the gap between the proposed modified delivery and the planned one. The innovative aspect of the proposed approach is to balance the social objective of a national authority, thus minimizing the risk on the road infrastructures, with the economical objective of the DG distribution companies that have to minimize the actual time, as defined by the planned deliveries. The proposed DG transport model is defined according to a system of systems view. Each subsystem (SS) represents either a regional area or, more commonly, a segment of a road. The proposed approach provides a useful tool for evaluating the optimal speed for DG vehicles in each SS and the optimal amount of DG flow that should transit from one SS to another, following the planned delivery schedule. The problem has been tackled in two different formulations. First, a nonlinear mathematical programming formulation is defined. Then, according to simplifying assumptions, the problem is solved as a discrete-time finite horizon linear quadratic optimal control problem with a state feedback control. An exemplificative case study is used to show a comparison between the two formulations, as well as the effects of a risk sudden change in the overall DG routing.