Timeline
Timeline
2025-10-09
init
This article introduces the specific operation process for connecting a Raspberry Pi to the campus network, including configuring wireless network parameters, verifying IP connection status, and troubleshooting failure logs. It also summarizes the steps to write and run an authentication script through packet capture technology to achieve automatic network authentication and login.
First enable wlan, then let wlan connect to the campus network, the Raspberry Pi can be used
1 | sudo raspi-config |
Then in the System Option, enter the ssid and passphrase in Wireless LAN
Or write to /etc/wpa_supplicant/wpa_supplicant.conf
1 | ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev |
Then restart the wpa_supplicant service
1 | sudo systemctl restart wpa_supplicant |
After the above operations, use the ifconfig command to check if the inet of wlan has an IP address. If it does, it means the campus network has been connected, and the next step is to pass the authentication.
If it is not successful, call the following command to view the logs
1 | journalctl -u wpa_supplicant -n 50 --no-pager |
Packet capture:

Through packet capture, the following script can be written:
1 | # First get the IPv4 and MAC of wlan0 |
After running the above script, test whether the connection is successful
1 | ping www.baidu.com |