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
47 영화의 매트릭스의 네오의 컴퓨터 화면 프로그램 digipine 2021.02.04 1051
46 L4 장비의 핵심 로드 밸런싱(Load Balancing) digipine 2017.11.03 946
45 삼성의 새로운 갤럭시 S 폰 예상보다 빨리 출시 예정 file digipine 2020.11.05 926
44 SECS 프로토콜 개요 digipine 2017.11.03 905
43 GDPR 유럽 일반 개인 정보보호법 시행 엉뚱도마뱀 2018.05.24 879
42 이더리움 (Ethereum) digipine 2018.02.08 826
41 서보 모터 (Servo-motor) 의 내부 구조와 회전 원리 file digipine 2017.11.02 807
» 임베디드 무선랜 개발 iwconfig wpa_supplicant digipine 2017.11.02 775
39 TI사의 DSP 종류 digipine 2017.11.02 769
38 윈도우XP 배경화면, '스마트폰용' 속편 출시 file 엉뚱도마뱀 2017.11.27 762
37 GA-P55A-UD3R rev 2.0 / GT 240 OSX 스노우 레파드 해킨가이드 digipine 2017.11.03 754
36 애플, 맥미니 2011 지원 종료 공식화, 신제품 출시는 미정 file 엉뚱도마뱀 2017.12.08 748
35 iPhone X의 Face ID RAW 데이터 영상 분석 및 은행권 앱 동향 file 엉뚱도마뱀 2017.11.27 669
34 해킨토시 설치법 GA-P55A-UD3R rev 2.0 / intel Core i5 760 / NVIDIA GeForce GT 240 digipine 2017.11.03 646
33 7 Best Music Players for Mac You Should Try file 엉뚱도마뱀 2017.12.07 601
32 Nintendo Switch 세계 누적 판매 대수 1,000만대 돌파 file 엉뚱도마뱀 2017.12.13 600
31 iPhone SE 2 2018년 상반기에 출시? file digipine 2017.12.11 540
30 Facebook 게시물을 검색하여 자살 암시를 발견하는 AI 서비스 시작 1 file 엉뚱도마뱀 2017.11.29 512
29 쿠버네티스, 도커 지원 중단 file digipine 2021.10.20 489
28 서드파티 애플 뮤직 앱 Soor, 맞춤형 Magic Mix 음악 리스트 file digipine 2022.02.04 483
Board Pagination Prev 1 2 3 ... 4 Next
/ 4