The detection of intrusions in IoT networks is essen- tial to maintain the availability and integrity of data transmitted and generated by devices connected to these networks. This is primarily when the data originates from critical activities, such as activities in the military, financial, industrial, and health sectors. Machine learning techniques have been adopted to create ways to detect or improve the accuracy of existing models for automatic intrusion detection. However, it is difficult to find in the literature an accurate intrusion detection technique in an IoT environment, as there are different types of attacks that can happen in different ways. Therefore, to solve this problem, this work proposes applying Fuzzy OPF (Optimum-Path Forest) as a new detection algorithm for any threat that escapes the regular traffic of an IoT network. We evaluate our proposed approach by using five different ML algorithms: Linear Discriminant Analysis, Support Vector Machine, Bayes, K-Nearest Neighbors, and Optimum-Path Forest. Experimental results analysis showed that our proposed model outperforms well-known algorithms in the literature regarding the Accuracy, Recall, and F1 metrics.