首页 > 系统服务 > 详细

ubuntu 设置静态ip,但显示scope global secondary ens33

时间:2019-09-19 16:17:48      阅读:460      评论:0      收藏:0      [点我收藏+]

设置静态ip

修改 /etc/network/interfaces 文件

技术分享图片
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens33
iface ens33 inet static
address 192.168.1.112
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens33
iface ens33 inet static
address 192.168.1.112
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8

重启网络

systemctl restart networking.service

问题:ip ad s 查看网络以前的旧ip还存在,新的ip虽然可以使用但会出现丢失的情况

技术分享图片

 

解决:

ip addr flush dev ens33

ifdown ens33
ifup ens33

 

ubuntu 设置静态ip,但显示scope global secondary ens33

原文:https://www.cnblogs.com/xingphimo/p/11550456.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!