ubuntu无线网卡创建wifi热点

参考资料

Ubuntu 12.04 – setting up my Wifi Hotspot

Making a WiFi Hotspot / Access Point using Linux & wifi lan card/USB adapter

实践环境 ubuntu 12.04LTS ,一个网卡通过pppoe连接ADSL,一个wan0开放热点

1、sudo apt-get install hostapd

2、sudo vi /etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=my_hotspot
channel=1
hw_mode=g
auth_algs=1
wpa=3
wpa_passphrase=1234567890
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP

3、sudo vi /etc/default/hostapd

RUN_DAEMON="yes"
DAEMON_CONF="/etc/hostapd/hostapd.conf"
DAEMON_OPTS="-dd"

 

 

4、如何启动hostapd

sudo /etc/init.d/hostapd –help
Usage: /etc/init.d/hostapd {start|stop|restart|force-reload|reload|status}
 

 

=====================================

安装dpcp-server

1、sudo apt-get install dhcp3-server

2、sudo vi /etc/default/isc-dhcp-server

Edit the line that says

INTERFACES=”"

To

INTERFACES=”wlan0″

3. sudo vi /etc/dhcp/dhcpd.conf

# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.100 192.168.0.200;
  option domain-name-servers 202.96.134.33;
  option domain-name "internal.example.org";
  option routers 192.168.0.1;
  option broadcast-address 192.168.0.255;
  default-lease-time 600;
  max-lease-time 7200;
}

4、如何启动dhcp-server

sudo /etc/init.d/isc-dhcp-server start
sudo /etc/init.d/isc-dhcp-server stop

 

 

============================================

sudo vi /etc/network/interfaces

 

auto wlan0
iface wlan0 inet static
address 192.168.0.1
netmask 255.255.255.0

sudo iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

原创文章,转载请注明: 转载自海波无痕

本文链接地址: ubuntu无线网卡创建wifi热点

文章的脚注信息由WordPress的wp-posturl插件自动生成

此条目发表在server分类目录,贴了, , , , , , , 标签。将固定链接加入收藏夹。

ubuntu无线网卡创建wifi热点》有 2 条评论

  1. tewuapple说:

    想问一下你是怎么开启ap热点的

    [回复]

    ziki 回复:

    需要两个网卡,一个网卡上网,一个无线网卡开启热点。

    [回复]

发表评论

电子邮件地址不会被公开。 必填项已用*标注

评论链接可以 移除 nofollow.