ubuntu如何设置静态IP? 设置静态IP 1.编辑/etc/network/interfaces文件: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network
ubuntu系统修改静态IP的方法是在修改/etc/network/interfaces文件,而树莓派此文件下有说明: # interfaces() ) and ifdown() # 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
一.Ubuntu16.04设置静态IP1.获取网卡的名字 ip route show 2.获取网卡的名字 vim /etc/network/interfaces auto ens33 iface ens33 inet static address 192.168.23.43 netmask 255.255.255.0 gateway 192.168.23.1 dns-nameserver 114.114.114.114 3.设置DNS sudo vi /etc/resolvconf/reso
网络配置的配置文件在/etc/sysconfig/network-scripts/下,文件名前缀为ifcfg-后面跟的就是网卡的名称,可以通过双TAB键查看然后编辑,也可以使用ifconfig查看,也可以使用命令: ls /etc/sysconfig/network-scripts/ifcfg-* --列出所有的设备配置文件 ifcfg-lo是本地回环地址的配置文件,所有计算机都有,不用动它,我们只需要修改ifcfg-eth0 vim /etc/sysconfig/network-scripts
一.静态IP地址配置 sudo vi /etc/network/interfaces 然后按照如下格式修改: 注意这里的网卡名字是ens33 auto lo iface lo inet loopback auto ens33 iface ens33 inet static address 192.168.1.106 netmask 255.255.255.0 gateway 192.168.1.1 二.配置DNS #临时修改 sudo vi /etc/resolv.conf #插入内容 name