The invention discloses a general method for configuring a WiFi device to make the same to connect a WiFi router. The method includes the following steps that: step 1, a unidirectional physical data transmission channel is established between the WiFi device and the WiFi router; step 2, user configuration data are written and are adopted as multicast data packets, wherein the user configuration data include the SSID and password of the WiFi router; step 3, the WiFi router continuously sends the multicast packets through IP multicast; step 4, the WiFi device continuously scan all channels at intervals until a certain channel captures the multicast packets of a WiFi link layer, captures the multicast packets of the WiFi link layer, and filters the captured multicast data packets through a destination MAC address and multicast information so as to filter out illegal data packets, and obtains legitimate data packets, decrypts the data packets, performs analysis to obtain the SSID and password in the data, and is connected to the WiFi router; and step 5, if the WiFi device is successfully connected to the WiFi router, the WiFi device returns successful connection information to the WiFi device, otherwise, the method returns to the step 4, and scanning is further carried out.