vi /etc/network/interfaces
如下:
# interfaces(5) file used by ifup(8) and ifdown(8)# Please note that this file is written to be used with dhcpcd# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet manual
auto wlan0
iface wlan0 inet static
address 192.168.1.88
netmask 255.255.255.0
gateway 192.168.1.1
wpa-ssid xxxx #连接的wifi的ssid
wpa-psk 密码 #连接的wifi密码
#wireless-channel 11
iface default inet dhcp
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
cd /etc/systemd/system/dhcpcd.service.d/
vi wait.conf
[Service]
ExecStart=
ExecStart=/sbin/dhcpcd -q -w -t 10
或者
[Service]
#ExecStart=#ExecStart=/sbin/dhcpcd -q -w