Along with the development of wireless communication technology, different wireless technologies suitable for a variety of situations have been widely used. Wireless technologies with different characteristics have deeply promoted the development of cyber-physical system (CPS). Various kinds of devices such as sensors, actuators and data processors in a CPS have been used to complete different tasks and also been equipped with different kinds of wireless communication technologies to meet different needs of work. Meanwhile, all these devices have to make communication mutually to keep the whole system effective. Gateways have been used to connect these equipments with different kinds of wireless technologies. Different devices pack information in data packets, and transmit them to each other through gateways. We propose a dynamic gateway bandwidth allocation algorithm, to maximise total packets delivery ratio. Simulation results have shown that this algorithm is efficient.