Ubuntu 配置ip地址

本身在玩Ubuntu的时候链接Xshell,可是Ubuntu的ens33没有显示IP地址,以下图:shell

配置步骤:vim

 一、修改配置文件  spa

sudo vim /etc/network/interfaces

添加:rest

 auto eth0
 iface eth0 inet static
 address 192.168.0.111  #配置没有被使用的ip地址
 netmask 255.255.255.0
 gateway 192.168.0.252 #写入网关地址
 dns-nameservers 1.1.1.1 #写dns解析地址

网关地址能够经过命令查看 :code

ip route

 

都配置好以后能够经过以下命令重启服务server

 /etc/init.d/networking restart

我是经过重启系统的。系统启动成功后,输入 ifconfig blog

 

xshell就能够经过上述ip链接。dns

相关文章
相关标签/搜索