The combination of the Internet of Things (IoT) and Cloud computing are both popular applications that are based on the Internet. However, the traditional networking structure can no longer support the transmission of the huge number of packets required by cloud computing and IoT. Therefore, a new-generation architecture, software-defined networking (SDN), came into being. The new-generation SDN can control routing through software, making flexible and convenient management a key feature of SDN. However, attacks and threats are prevalent in today’s networking environment. When an SDN controller encounters a hacker attack or virus infection, it will not function properly. Hence, we need to design a fault-tolerant mechanism for the above environment. In this paper, a fault-tolerant consensus protocol is proposed to improve the fault tolerance of SDNs with multiple controllers.