ubutun 配置静态ip

root@ubuntu:/etc/network# pwd
cd /etc/network
//进入/ect/network目录 打开interfaces文件
root@ubuntu:/etc/network# vim 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 interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens33 #网卡名称 根据需要修改
iface ens33 inet static #此处一定要写成static表示静态
address 192.168.0.110 #写上你要配置的静态ip地址 我的是192.168.0.111
gateway 192.168.0.1  #写上你的网关地址
netmask 255.255.255.0#写上子网掩码
//执行 命令 systemctl restart networking.service 重启网络服务
root@ubuntu:/etc/network# systemctl restart networking.service 
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容