logo

English

임베디드 무선랜 개발 iwconfig wpa_supplicant

by digipine posted Nov 02, 2017
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

필요한 소프트웨어
wireless-tools,  wpa_supplicant,  dhcpcd


iwconfig명령으로 사용 가능한 무선랜 카드 장치 이름 확인할 수 있다. wlan0이 무선 랜카드 임을 알 수 있다. 
$ iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bgn  Mode:Managed  Access Point: Not-Associated   
          Tx-Power=0 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          
sit0      no wireless extensions.

eth0      no wireless extensions.


유선 랜 장치를 비활성화하고 무선 랜 장치를 활성화 한다. 
ifconfig eth0 down
ifconfig wlan0 up


연결 가능한 무선 공유기의 ssid 이름 및 무선 보안 여부를 확인해야 함.
iwlist wlan0 scanning
.......................
Encryption key:on  <-- 무선 보안 사용 중임
ESSID:"ssid_name"  <-- ssid 이름
.......................
IE: WPA Version 1  <-- 무선 보안 정보
    Group Cipher : CCMP
    Pairwise Ciphers (1) : CCMP
    Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
    Group Cipher : CCMP
    Pairwise Ciphers (1) : CCMP
    Authentication Suites (1) : PSK
.......................

wpa_supplicant 명령을 사용하려면 wpa_supplicant.conf가 필요하다. 
이를 위해 우선 psk키를 생성한다.

wpa_passphrase ssid_name > /etc/wpa_supplicant/wpa_supplicant.conf  
password 입력 후 엔터 


입력한 password가 psk로 바꿔어 진 것을 확인 할 수 있다. 
cat /etc/wpa_supplicant/wpa_supplicant.conf
# reading passphrase from stdin
network={
    ssid="ssid_name"
    #psk="입력한 password"   
    psk="생성된 psk"
}


생성된 파일 wpa_supplicant.conf에 추가 정보를 입력한다. 
# reading passphrase from stdin
network={
        ssid="ssid_name"
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=CCMP
        group=CCMP
        psk="생성된 psk"
}


유선 랜 장치를 중지시키고 
ifconfig eth0 down

무선 랜  장치를 활성화 한다. 
ifconfig wlan0 up

ssid가 ssid_name인 공유기에 연결한다
iwconfig wlan0 essid "ssid_name"
wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf &
[1] 1920
CTRL-EVENT-SCAN-RESULTS 
Trying to associate with 00:00:00:00:00:00 (SSID='ssid_name' freq=2412 MHz)
Associated with 00:00:00:00:00:00
WPA: Key negotiation completed with 00:00:00:00:00:00 [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (auth) [id=0 id_str=]


ip를 dhcp로 할당 받는다
dhcpcd wlan0 &
[2] 1923
wlan0: dhcpcd 4.0.15 starting
wlan0: broadcasting for a lease
wlan0: offered 192.168.0.2 from 192.168.0.1
wlan0: acknowledged 192.168.0.2 from 192.168.0.1
wlan0: checking 192.168.0.2 is available on attached networks
wlan0: leased 192.168.0.2 for 864000 seconds


또는 수동으로 ip를 설정하려면
$ ifconfig wlan0 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255
$ route add default gw 192.168.0.1 wlan0
$ echo nameserver 192.168.0.1 > /etc/resolv.conf   <--DNS 서버 설정 

인터넷 사용가능 여부 테스트
ping google.com
PING google.com (74.125.127.147) 56(84) bytes of data.
64 bytes from pz-in-f147.1e100.net (74.125.127.147): icmp_seq=1 ttl=48 time=135 ms



참고 

Wireless LAN with WPA (AES)

 
TAG •

List of Articles
No. Subject Author Date Views
67 해킨토시 설치법 GA-P55A-UD3R rev 2.0 / intel Core i5 760 / NVIDIA GeForce GT 240 digipine 2017.11.03 643
66 파나소닉, 풀 스펙 8K 동영상 신호 전송용 단일 케이블 및 커넥터 솔루션 개발 file lizard2019 2019.06.07 1187
65 트위터에서 다크모드 설정 방법 file digipine 2022.01.20 185
64 퀄컴, 갤노트20 두뇌 '스냅드래곤865+' 공개 file digipine 2020.07.09 303
63 쿠버네티스, 도커 지원 중단 file digipine 2021.10.20 489
62 차세대 비휘발성 메모리 기술동향 file digipine 2017.11.02 247
» 임베디드 무선랜 개발 iwconfig wpa_supplicant digipine 2017.11.02 775
60 임베디드 Linux 시스템 부팅 시 프로그램 자동 실행 digipine 2017.11.03 4154
59 이더리움 (Ethereum) digipine 2018.02.08 826
58 윈도우XP 배경화면, '스마트폰용' 속편 출시 file 엉뚱도마뱀 2017.11.27 761
57 영화의 매트릭스의 네오의 컴퓨터 화면 프로그램 digipine 2021.02.04 1050
56 애플, 서드파티 앱마켓 진출 허용하나 lizard2019 2022.12.18 237
55 애플, 맥미니 2011 지원 종료 공식화, 신제품 출시는 미정 file 엉뚱도마뱀 2017.12.08 748
54 애플 워치와 모방제품과의 승부 file lizard2019 2020.05.26 454
53 애플 드디어 ARM 기반의 맥 출시 예정, 11월 10일 digipine 2020.11.09 300
52 암호화폐 (Crypto Currency) 비트코인 file digipine 2018.02.08 3515
51 안드로이드 의 써드파티 어플의 SD RW 권한 부여 digipine 2017.11.03 336
50 스니핑 개념, 공격기법, 방어법, 참고할만한 오픈소스 라이브러리 및 툴 digipine 2017.11.03 1300
49 서보모터의 기초와 제어 file digipine 2017.11.02 423
48 서보 모터 (Servo-motor) 의 내부 구조와 회전 원리 file digipine 2017.11.02 807
Board Pagination Prev 1 2 3 ... 4 Next
/ 4