The rise of network attacks has emerged as a pressing concern for companies and individuals. A Network Intrusion Detection System (NIDS) is employed at the network edge and monitors the traffic exchanged between the network and the cloud. An anomaly detection NIDS detects benign vs attack traffic while a misuse detection NIDS detects benign vs. specific attack. In this paper, we propose two machine learning based NIDS frameworks, an anomaly detection, and a misuse detection NIDS that can effectively detect and classify IoT network attacks. We used Kitsune IoT network attack dataset that contains 9 types of attacks. We used random undersmapling to reduce the dataset size. Then, we employed ANOVA and Chi-square feature selection techniques and studied a variety of machine learning algorithms for binary classification (anomaly detection) and family classification (misuse detection). We studied different models to find the best combination of feature selection method, number of features, and hyperparameters for each model for both binary and family classifications. Our experimental results demonstrated that our proposed Random Forest and Extreme Gradient Boost binary classifiers and Random Forest family classifier with ANOVA feature selection outperform other models and existing research in accuracy.