由于操作系统是基于dibian的底层来操作

我们需要编辑2个文件

/etc/network/interfaces(配置IP和网关)
/etc/resolv.conf(配置DNS服务器)

nano /etc/network/interfaces
auto eth0 #开机自动连接网络

iface lo inet loopback

allow-hotplug eth0

iface eth0 inet static #static表示使用固定ip,dhcp表述使用动态ip

address 10.10.10.155 #设置ip地址

netmask 255.255.255.0 #设置子网掩码

gateway 10.10.10.2 #设置网关

broadcase 10.10.10.255#设置广播地址(也可以不写)