CentOS或者linux 重启虚拟机IP丢失问题的解决方法

1. 开启CentOS 但是长时间没有使用再打开IP丢失无法获取到重启网络也不行重新启动计算机也不行

2.此时如果你是win系统里边安装的虚拟机就应该检查一下你的任务管理器中的

  VMnetDHCP  这个服务是否开启,我是不小心关闭了,先保证这个服务开启再进行下边的操作

Linux renew ip command
$ sudo dhclient -r //release ip 释放IP
$ sudo dhclient //获取IP
 
Now obtain fresh IP:
$ sudo dhclient 
There is no need to restart network service. Above command should work with any Linux distro such as RHEL, Fedora, CentOS, Ubuntu and others. On a related note you can also try out the following commands:
# ifdown eth0
# ifup eth0
# /etc/init.d/network restart 
OR
# /etc/init.d/networking restart
Linux renew ip command
$ sudo dhclient -r //release ip 释放IP
$ sudo dhclient //获取IP


Now obtain fresh IP:
$ sudo dhclient 
There is no need to restart network service. Above command should work with any Linux distro such as RHEL, Fedora, CentOS, Ubuntu and others. On a related note you can also try out the following commands:
# ifdown eth0
# ifup eth0
# /etc/init.d/network restart 
OR
# /etc/init.d/networking restartservice network restart
这个是redhat的 不同版本 命令不同 就是重起网络 


前提是你的配置是DHCP 通常会获得和之前一样的地址
如果你想要获得不同的IP, 就需要在DHCP 客户端指定下 机器的mac 和地址 


DHCP 都有个过期时间 把过期时间设置非常短 清除缓存 不知道会不会获得不同地址 


所有的前提是你的DHCP服务器 支持....

猜你喜欢

转载自blog.csdn.net/qq_36090419/article/details/80958421