linux

EmbeddedLinux 무선랜 사용

afewgood 2021. 7. 20. 14:40

01_ifconfig 명령으로 사용가능한 네트워크 장치 확인
[afewgood@ubuntu]# ifconfig

02_유선 랜 장치를 비활성화하고 무선 랜 장치를 활성화 한다. 
[afewgood@ubuntu]# ifconfig eth0 down
[afewgood@ubuntu]# ifconfig wlan0 up

03_wpa_supplicant 명령을 사용하려면 wpa_supplicant.conf가 필요하다. 
이를 위해 우선 psk키를 생성한다.(최초 1회)
- wpa_passphrase ssid_name ssid_password > wpa_supplicant.conf
[afewgood@ubuntu]# wpa_passphrase AFewGood 12345 > /etc/wpa_supplicant.conf

04_SSID 접속
[afewgood@ubuntu]# iwconfig wlan0 essid "AFewGood"

05_wpa_supplicant 실행
[afewgood@ubuntu]# wpa_supplicant -D wext -B -i wlan0 -c /etc/wpa_supplicant.conf
 -D wext = Linux wireless extensions (generic)
 -B = run daemon in the background
 -i = interface name
 -c = Configuration file

06_ifconfig 명령으로 사용가능한 네트워크 장치 확인
[afewgood@ubuntu]# ifconfig

07_dhcp실행
[afewgood@ubuntu]# udhcpc -i wlan0