1.打开配置文件
/etc/networking/interfaces
2.添加下面代码
# The wlan network interface
auto wlp1s0
iface wlp1s0 inet static
address 192.168.0.241
netmask 255.255.255.0
gateway 192.168.0.1
wpa-conf /etc/wpa.conf
3.重启网卡
/etc/init.d/networking restart
动态IP配置文件参考
# The wlan network interface
iface wlp1s0 inet dhcp
wpa-conf /etc/wpa.conf