/etc/network/interfaces

点击(此处)折叠或打开
  1. # Include files from /etc/network/interfaces.d:
  2. source-directory /etc/network/interfaces.d
  3. auto lo
  4. iface lo inet loopback
  5. #iface eth0 inet manual
  6. allow-hotplug eth0
  7. iface eth0 inet static
  8. address 192.168.1.100
  9. netmask 255.255.255.0
  10. gateway 192.168.1.1
  11. dns-nameserver 192.168.1.1
  12. #iface eth0 inet dhcp
  13. # need auto line unless wlan will not start until lan up
  14. auto wlan0
  15. allow-hotplug wlan0
  16. iface wlan0 inet dhcp
  17. wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf

  1. ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
  2. update_config=1
  3. network={
  4.   ssid="xxxx"
  5.   #psk="yyyy"
  6.   psk=zzzz
  7.   key_mgmt=WPA-PSK
  8. }

上面的ssid,psk是加密的。通过wpa_passphrase生成
  1. # wpa_passphrase myssid password
  2. network={
  3. ssid="myssid"
  4. #psk="password"
  5. psk=e53bb7df43156b8a6ad5d3ea5bb4078fada2531e2d5d5208c3bc1a17c3278220
  6. }



12-08 12:27