2

Debian 配置 WiFi 热点

 1 year ago
source link: https://www.taterli.com/9374/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Debian 配置 WiFi 热点

Debian 配置 WiFi 热点

在某些地方只有有线网和WiFi网卡,手机也想联网,最方便就是配个无线热点,实际也非常简单.

确认一下自己网卡支持频段.

root@debian:~# iwlist wlp4s0 freq
wlp4s0    26 channels in total; available frequencies :
          Channel 01 : 2.412 GHz
          Channel 02 : 2.417 GHz
          Channel 03 : 2.422 GHz
          Channel 04 : 2.427 GHz
          Channel 05 : 2.432 GHz
          Channel 06 : 2.437 GHz
          Channel 07 : 2.442 GHz
          Channel 08 : 2.447 GHz
          Channel 09 : 2.452 GHz
          Channel 10 : 2.457 GHz
          Channel 11 : 2.462 GHz
          Channel 12 : 2.467 GHz
          Channel 13 : 2.472 GHz
          Channel 36 : 5.18 GHz
          Channel 40 : 5.2 GHz
          Channel 44 : 5.22 GHz
          Channel 48 : 5.24 GHz
          Channel 52 : 5.26 GHz
          Channel 56 : 5.28 GHz
          Channel 60 : 5.3 GHz
          Channel 64 : 5.32 GHz
          Channel 149 : 5.745 GHz
          Channel 153 : 5.765 GHz
          Channel 157 : 5.785 GHz
          Channel 161 : 5.805 GHz
          Channel 165 : 5.825 GHz
root@debian:~# 

支持5G,不错,然后给网卡绑一个桥,这样新建的热点就等于直接有线一样.

auto lo
iface lo inet loopback

auto enp3s0
iface enp3s0 inet manual

auto wlp4s0
iface wlp4s0 inet manual

auto vmbr0
iface vmbr0 inet static
  address 192.168.31.6/24
  gateway 192.168.31.1
  bridge_ports enp3s0 wlp4s0
  dns-nameserver 8.8.8.8
  dns-nameserver 8.8.4.4

如果不支持5G,就需要设置hw_mode=g或者b,根据网卡支持而定.当然如果是Intel网卡,目前也是不能用5G的.那是因为这个BUG( https://bugzilla.kernel.org/show_bug.cgi?id=206469#c2 )限制.

参考配置.

interface=wlp4s0 # WiFi 网卡名
bridge=vmbr0 # 网桥名
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=test # SSID名
country_code=CN # 射频规范
ieee80211d=0
ieee80211h=0 # 是否遵守规范,不遵守可以获得更好的信号,毕竟可以用你国家不允许的频道.
hw_mode=a # a就是5G.
channel=149 # 使用通道
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=-1
fragm_threshold=-1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
ieee80211n=1
ieee80211ac=1
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1
wpa=2
wpa_passphrase=xxoo # 密码
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP

为什么不需要建DHCP呢,因为他们在一个网桥上呢,由路由直接把IP各种分配给他就行.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK