三天时间!终于让 Boardcom BCM4310/4312 无线网卡在Ubuntu 9.10下工作起来了
下午实验Blackberry WIFI连接笔记本共享上网总结。
1.操作系统
Debian sid
kernel:Linux debian 2.6.38-2-686
2.需求软件
iw
hostapd
ISC DHCP server
3.配置过程
3.1查看无线网卡是否具有AP功能
#iw list
注意Supported interface modes字段
* IBSS
* managed
* AP
* AP/VLAN
* monitor
* mesh point
显示有AP,说明无线网卡可以当着软AP使用。
3.2配置hostapd.conf
#vim /etc/hostapd/hostapd.conf
ssid=home
hw_mode=g
channel=10
interface=wlan0
driver=nl80211
auth_algs=1
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
rsn_pairwise=TKIP CCMP
3.3配置DHCP
#vim /etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
option routers 192.168.2.1;
option domain-name “test.org”;
option domain-name-servers 218.6.200.139,61.139.2.69;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.10 192.168.2.20;
}
3.4配置无线网卡IP
#ifconfig wlan0 192.168.2.1 netmask 255.255.255.0
3.5配置IPTABLES转发
# iptables -F
# iptables -P INPUT ACCEPT
# iptables -P FORWARD ACCEPT
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
3.6启动hostapd
#hostapd /etc/hostapd/hostapd.conf
到此Blackberry就能连接到无线网卡上网冲浪了。
PS1:Debian系统自带的iwconfig不能设置我的无线网卡为master模式,所以抛弃它了。
PS2:Gnome的NetworkManager里面提供的AD-HOC功能,BB也不支持,同样抛弃它。
PS3:如果有linuxer也想折腾这个方法,在你的机器上有3个地方需要修改。
option domain-name “test.org”; --将其修改为你机器/etc/hosts/里面的名字
option domain-name-servers 218.6.200.139,61.139.2.69; --修改为你所在地区的DNS
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE --如果你是笔记本连接路由器上网,将ppp0修改为你的有线网卡接口,比如eth0
1.操作系统
Debian sid
kernel:Linux debian 2.6.38-2-686
2.需求软件
iw
hostapd
ISC DHCP server
3.配置过程
3.1查看无线网卡是否具有AP功能
#iw list
注意Supported interface modes字段
* IBSS
* managed
* AP
* AP/VLAN
* monitor
* mesh point
显示有AP,说明无线网卡可以当着软AP使用。
3.2配置hostapd.conf
#vim /etc/hostapd/hostapd.conf
ssid=home
hw_mode=g
channel=10
interface=wlan0
driver=nl80211
auth_algs=1
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
rsn_pairwise=TKIP CCMP
3.3配置DHCP
#vim /etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
option routers 192.168.2.1;
option domain-name “test.org”;
option domain-name-servers 218.6.200.139,61.139.2.69;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.10 192.168.2.20;
}
3.4配置无线网卡IP
#ifconfig wlan0 192.168.2.1 netmask 255.255.255.0
3.5配置IPTABLES转发
# iptables -F
# iptables -P INPUT ACCEPT
# iptables -P FORWARD ACCEPT
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
3.6启动hostapd
#hostapd /etc/hostapd/hostapd.conf
到此Blackberry就能连接到无线网卡上网冲浪了。
PS1:Debian系统自带的iwconfig不能设置我的无线网卡为master模式,所以抛弃它了。
PS2:Gnome的NetworkManager里面提供的AD-HOC功能,BB也不支持,同样抛弃它。
PS3:如果有linuxer也想折腾这个方法,在你的机器上有3个地方需要修改。
option domain-name “test.org”; --将其修改为你机器/etc/hosts/里面的名字
option domain-name-servers 218.6.200.139,61.139.2.69; --修改为你所在地区的DNS
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE --如果你是笔记本连接路由器上网,将ppp0修改为你的有线网卡接口,比如eth0
作者: Dohko 发布时间: 2011-04-16