Honeypot is an active defense mechanism in network security protection. Its main purpose is to collect various intrusion information. However, due to the complexity of attacker penetration attacks and the diversity of host vulnerabilities, a simple honeypot can't to meet the defense requirements, so a honeynet system formed by a combination of various honeypots has emerged. But what kind of honeypots are included in the honeynet? How are honeypots connected? What is the reasonable size of the honeynet? These problems are restricting the development of honeynet. Therefore, the research of this paper is to analyze the vulnerability of an nodes in the network by establishing an attack graph, so as to formulate a honeynet deployment strategy. However, due to the difference in the network structure and the size of the honeynet, the effect of security protection will be very different. At the same time, considering the maintenance cost and protection benefits of the honeynet, when adopting a dynamic honeynet deployment method, we need to adjust the type and number of honeypots in the honeynet at any time. This paper uses ant colony algorithm and wolf swarm algorithm to optimize the honeynet, so as to realize the simplification of the attack graph and the dynamic configuration of the honeynet.