千家信息网

ubuntu中怎么将dhcp改为静态IP

发表于:2025-02-07 作者:千家信息网编辑
千家信息网最后更新 2025年02月07日,本篇文章为大家展示了ubuntu中怎么将dhcp改为静态IP,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。静态ip不能连接外网因为老的虚拟机有ubuntu桌面
千家信息网最后更新 2025年02月07日ubuntu中怎么将dhcp改为静态IP

本篇文章为大家展示了ubuntu中怎么将dhcp改为静态IP,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

静态ip不能连接外网

因为老的虚拟机有ubuntu桌面 以及一些磁盘的问题, 想 迁移 自己的虚拟机,连带着把ip也迁移,(公司有些界面是 通过我的虚拟机ip访问的。)

编辑

root@ubuntu:/home/ubuntu# cat /etc/network/interfaces# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceauto eth0iface eth0 inet staticaddress 168.192.10.72netmask 255.255.255.0gateway 168.192.0.1

然后重启即可

上述内容就是ubuntu中怎么将dhcp改为静态IP,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注行业资讯频道。

0