/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 //设置eth0的状态遵循手册
allow-hotplug wlan0 //允许-热插拔 wlan0
iface wlan0 inet manual //设置wlan0为状态遵循手册
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf //wpa协议文件的位置
allow-hotplug wlan1 //允许-热插拔 wlan1
iface wlan1 inet manual //设置wlan1为状态遵循手册
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf //wpa协议文件的位置

首先查看了一下我的电脑PC网络

IP地址是10.22.168.7

掩码是255.255.252.0 注意这里确定主机号是21

网管是xxxx

树莓派网络配置记录_ip地址

接下来配置树莓派中的文件