2009年8月13日

|G1| 让一个无线网卡即当AP又当STA

公司用WIFI上网,只给笔记本分配了一个MAC地址,G1来了没法上网。

想了一个办法,把笔记本虚拟成一个AP,这样需要笔记本的无线网卡需拟成两块无线网卡:一个作STA客户端与公司的WIFI连接,另一个模拟AP供G1连接

用madwifi,已经能把原先的一个 ath0 设备变成 ath0/ath1 ,AP也出来了,可是网络很不稳定,时断时续,还需要找问题继续改进。。。

/etc/init.d/NetworkManager stop
modprobe -r ath_pci ath_rate_sample ath_hal wlan_scan_sta wlan_wep wlan_tkip wlan_xauth wlan_scan_ap wlan
modprobe ath_pci autocreate=none

wlanconfig ath create wlandev wifi0 wlanmode sta nosbeacon
wlanconfig ath create wlandev wifi0 wlanmode ap

ifconfig ath0 up
iwconfig ath0 essid myspace
iwpriv ath0 mode 3
dhclient ath0

ifconfig ath1 192.168.31.1/24
ifconfig ath1 up
iwconfig ath1 essid Android
/etc/init.d/dhcp3-server