“模板:WIFI”的版本间的差异

来自ARM Wiki
跳转至: 导航搜索
第44行: 第44行:
 
allow-hotplug wlxec3dfd322b06
 
allow-hotplug wlxec3dfd322b06
 
iface wlxec3dfd322b06 inet static
 
iface wlxec3dfd322b06 inet static
         wpa-conf /etc/norco.conf
+
         wpa-conf /etc/wpa_supplicant.conf
 
         address 192.168.100.148
 
         address 192.168.100.148
 
         netmask 255.255.255.0
 
         netmask 255.255.255.0
第54行: 第54行:
  
 
:::[[File:无线静态IP.JPG|frameless|650px|无线静态IP]]
 
:::[[File:无线静态IP.JPG|frameless|650px|无线静态IP]]
 +
 +
::* DNS设置
 +
:::<syntaxhighlight lang="bash" line>
 +
cat <<EOF > /etc/resolv.conf      //interfaces配置文件的优先级大于此文件,配置静态IP时设置DNS会让此文件失效
 +
nameserver 8.8.8.8                //主DNS
 +
nameserver 114.114.114.114        //副DNS
 +
 +
EOF
 +
</syntaxhighlight>
 +
::* 查看目前使用的DNS服务
 +
:::<syntaxhighlight lang="bash" line>
 +
sudo apt install dnsutils
 +
nslookup www.baidu.com  //主机设置的DNS为8.8.8.8
 +
</syntaxhighlight>
 +
:::[[File:DNS.png|frameless|650px|DNS]]

2020年5月20日 (三) 17:25的版本

  • 硬件
  • 默认无线网卡硬件为
    RTL8188ETV & RTL8723BU
  • RTL8723BU为带蓝牙模块
  • 查看设备
  • 查看所有设备列表
1 ip link show
无线网卡设备
  • 使用
  • 动态IP
 1 cat << EOF >> /etc/network/interfaces
 2 # Wireless interface
 3 auto wlan0
 4 allow-hotplug wlan0
 5 iface wlan0 inet dhcp
 6         wireless_mode managed
 7         wireless_essid any
 8         wpa-driver nl80211
 9         wpa-conf /etc/wpa_supplicant.conf
10 
11 EOF
  • wpa_supplicant.conf为wpa_passphrase生成的文件,例如:(ssid:test passwd:123456)
1 wpa_passphrase test 123456 > /etc/wpa_supplicant.conf
  • 注意:WiFi名称可能不是wlan0,请将wlan0换为实际的无线网卡名称
无线动态IP
  • 静态IP
 1 cat <<EOF >> /etc/network/interfaces
 2 auto wlxec3dfd322b06
 3 allow-hotplug wlxec3dfd322b06
 4 iface wlxec3dfd322b06 inet static
 5         wpa-conf /etc/wpa_supplicant.conf
 6         address 192.168.100.148
 7         netmask 255.255.255.0
 8         gateway 192.168.100.1
 9         dns-nameservers 223.5.5.5
10 EOF
  • 注意:WiFi名称可能不是wlan0,请将wlan0换为实际的无线网卡名称
无线静态IP
  • DNS设置
1 cat <<EOF > /etc/resolv.conf      //interfaces配置文件的优先级大于此文件,配置静态IP时设置DNS会让此文件失效
2 nameserver 8.8.8.8                //主DNS
3 nameserver 114.114.114.114        //副DNS
4 
5 EOF
  • 查看目前使用的DNS服务
1 sudo apt install dnsutils
2 nslookup www.baidu.com  //主机设置的DNS为8.8.8.8
DNS