vim /etc/network/interfaces
这个是ubuntu 每个系统不太一样
iface enp3s0 inet dhcp
上面是动态的
iface enp3s0 inet static
address x.x.x.x
netmask 255.255.255.248
gateway x.x.x.x
dns-nameservers 61.161.147.209
上面是静态的
然后重启 /etc/init.d/networking restart
局域网设置静态的 ifconfig看一下网卡名 比如enp3s0
iface enp3s0 inet static
ip是192.168.1.5差不多这样具体看一下ifconfig分给你的
掩码和dns跟你上一级的一样
网关基本上都是路由器的web访问地址(基本上 可能不是,不是就自己找一下)
查看网络通不通先ping网关 网关都ping不通说明你网关可能写错了