With the popularization of network applications and the great changes in the international political, economic and military situations, network security is becoming more and more important. As an important part of network security, network intrusion detection (NID) is still facing the problem of low detection rate and difficulty to meet the real-time demand with the rapid increase of network traffic. Therefore, for the requirement of fast and accurate detection in real-time applications, this paper proposes a NID method based on optimized multiclass support vector machine (SVM). Firstly, the ReliefF feature selection algorithm is introduced to extract features with heuristic search rules based on variable similarity, which reduces the complexity of features and the amount of calculation; Secondly, a SVM training method based on data block method is proposed to improve the training speed; Finally, a multiclass SVM classifier is designed for typical attack types. Experimental results show that the proposed optimization method can achieve a detection rate of 96.9% and shorten the training time by 13.2% on average.