ubuntu如何更改ip地址

2023年11月2日08:14:52 发表评论 587 views

具体操作步骤:

 

1.首先通过快捷键【Ctrl+Alt+T】打开终端命令行模式。

 

2.输入以下命令打开ubuntu的网络配置文件。

sudo vi /etc/network/interfaces

3.根据自己的需求修改设置address、gateway、netmask这三个值即可。

  1. # The primary network interface iface eth0 inet static
  2. auto eth0
  3. iface eth0 inet static
  4. address 192.168.1.110 #ip地址
  5. gateway 192.168.1.1 #网关
  6. netmask 255.255.255.0 #子网掩码

4.最后使用以下命令使网络设置生效即可。

sudo /etc/init.d/networking restart

发现敲了上面命令不行,就重启了一下虚拟机就OK了。


欢迎来到菜鸟头头的个人博客
本文章百度已收录,若发现本站有任何侵犯您利益的内容,请及时邮件或留言联系,我会第一时间删除所有相关内容。

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: