This is G o o g l e's cache of http://www.debianclub.com/node/41 as retrieved on 15 Feb 2007 23:36:31 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?hl=en&q=cache%3Ahttp%3A%2F%2Fwww.debianclub.com%2Fnode%2F41&btnG=Search


Google is neither affiliated with the authors of this page nor responsible for its content.

User login

Links

debianclub.com
debian.org
ubuntuclub.com
blognone.com

Syndicate

Syndicate content

ifupdown กับเครือข่ายไร้สาย

จาก ตอนที่แล้ว ที่ได้เกริ่นถึง ifupdown แบบปกติไปแล้ว คราวนี้จะมาดูการใช้งานลักษณะอื่นบ้าง โดยในตอนนี้จะกล่าวถึงการตั้งค่าเครือข่ายไร้สาย

ถ้าเครือข่ายของคุณเป็นแบบไร้สาย จะมีค่าพารามิเตอร์ของ Wi-Fi ที่ต้องเซ็ตด้วย ซึ่งคำสั่งสำหรับสั่งแบบ manual ก็คือ iwconfig ซึ่งอยู่ในแพกเกจ wireless-tools เช่น คำสั่งง่ายๆ สำหรับตรวจหา wireless interface ในเครือข่ายก็:

# iwconfig

จะตรวจ interface เครือข่ายทั้งหมด แล้วรายงานว่ามี wireless extension หรือไม่ ส่วนการกำหนดค่าพารามิเตอร์ Wi-Fi ก็ใช้คำสั่งเดียวกัน โดยระบุ interface ที่จะเซ็ต พร้อมด้วยพารามิเตอร์ต่างๆ เช่น

# iwconfig wlan0 mode managed essid my-essid key xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx

เป็นการกำหนดโหมดของ wireless interface ให้เป็นโหมด managed, ระบุ ESSID พร้อมกำหนด WEP key ของเครือข่าย

# iwconfig wlan0 mode ad-hoc channel 11 essid my-essid key xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx

กำหนดเป็นโหมด ad-hoc ใช้สัญญาณช่อง 11 ระบุ ESSID พร้อมกำหนด WEP key ของเครือข่าย

ค่าต่างๆ เหล่านี้ สามารถระบุใน /etc/network/interfaces เพื่อเป็นค่าตั้งสำหรับ ifupdown ได้ โดยใช้บรรทัดกำหนดค่าต่างๆ โดยเติม wireless_ ข้างหน้า เช่น

iface wlan0 inet dhcp
    wireless_mode managed
    wireless_essid my-essid
    wireless_key   xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx

หรือ

iface wlan0 inet static
    # wireless parameters
    wireless_mode ad-hoc
    wireless_channel 11
    wireless_essid my-essid
    wireless_key   xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx
    # IP
    address  192.168.1.2
    gateway  192.168.1.1

แต่ถ้าระบบของคุณใช้ WPA ก็สามารถกำหนดได้เหมือนกัน โดยต้องติดตั้งแพกเกจ wpasupplicant เพิ่ม แต่คำสั่งระดับล่าง (wpa_supplicant และ wpa_cli) นั้น ค่อนข้างซับซ้อน โดยแบ่งเป็น daemon และการเชื่อมต่อด้วยบรรทัดคำสั่ง ในที่นี้ ขอข้ามไปพูดถึงการเชื่อมรวมกับ ifupdown เลยละกัน

บรรทัดที่เกี่ยวกับ WPA จะขึ้นต้นด้วย wpa- เช่น

iface wlan0 inet dhcp
    wpa-driver hostap
    wpa-ssid   my-essid
    wpa-psk    passphrase

เป็นการกำหนดให้ใช้ driver hostap, กำหนด SSID และวลีรหัสผ่าน ซึ่งอาจจะเป็นข้อความเปล่า หรือค่าเลขฐานสิบหกที่แปลงจากข้อความเปล่าก็ได้ (ตามที่กำหนดที่ access point)

ยังมีค่าอื่นๆ ที่เป็นไปได้อีก ซึ่งรายละเอียดของ WPA ค่อนข้างเยอะ คุณอาจศึกษาได้จากแฟ้ม /usr/share/doc/wpasupplicant/README.mode.gz ในเครื่องของคุณ ซึ่งในนั้น จะอธิบายถึงการเซ็ตโหมด roaming เพิ่มเติมจากโหมด managed ด้วย

ขออภัยด้วยที่คำอธิบายเกี่ยวกับ WPA สั้นไปหน่อย เพราะยังไม่มีโอกาสได้ใช้เองนั่นเอง ถ้าใครมีประสบการณ์ ช่วยมาแบ่งปันกันบ้างก็ดีนะครับ