The invention relates to a method for assigning integrated routing and channels of cognitive wireless mesh networks. The method comprises the following steps that: a, a node senses external environment, broadcasts sense information to neighboring nodes, and acquires a list of the neighboring nodes; b, the node attempts to pass a topological form of a routing tree and chooses assignment channels according to metric values of channel statistics; c, the nodes are connected to a network, and by sorting hop counts and the metric values of channel statistics, the node with few hop counts or a small metric value of channel statistics is chosen as a father node; and d, the nodes exit from the network, and an exiting mode is chosen on the basis whether the node is the father node or a child node, and the information of the routing tree is updated. The method has the advantages of considering the characteristics of the dynamic change of the number of spectrum holes in cognitive environment, reasonably and effectively assigning channels and selected routing, balancing channel load, reducing interference between adjacent channels, avoiding too heavy load of individual channels and increase in time delay, giving full play to the advantages of multi-channel parallel transmission and improving network transmission performance.