点击(此处)折叠或打开
- # Include files from /etc/network/interfaces.d:
- source-directory /etc/network/interfaces.d
- auto lo
- iface lo inet loopback
- #iface eth0 inet manual
- allow-hotplug eth0
- iface eth0 inet static
- address 192.168.1.100
- netmask 255.255.255.0
- gateway 192.168.1.1
- dns-nameserver 192.168.1.1
- #iface eth0 inet dhcp
- # need auto line unless wlan will not start until lan up
- auto wlan0
- allow-hotplug wlan0
- iface wlan0 inet dhcp
- wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
/etc/wpa_supplicant/wpa_supplicant.conf
- ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
- update_config=1
- network={
- ssid="xxxx"
- #psk="yyyy"
- psk=zzzz
- key_mgmt=WPA-PSK
- }
上面的ssid,psk是加密的。通过wpa_passphrase生成
- # wpa_passphrase myssid password
- network={
- ssid="myssid"
- #psk="password"
- psk=e53bb7df43156b8a6ad5d3ea5bb4078fada2531e2d5d5208c3bc1a17c3278220
- }