ubuntu设置固定ip

本文共有435个字,关键词:

问题:如何设置静态ip

解决:设置/etc/network/interfaces文件

方法:

sudo vim /etc/network/interfaces

增加如下内容

auto eth0
iface eth0 inet static
address 192.168.7.124
netmask 255.255.255.0
gateway 192.168.7.1
dns-nameservers 218.2.2.2 218.4.4.4

之后重启网卡

sudo /etc/init.d/networking restart

参考:

https://blog.csdn.net/xiongchun11/article/details/53928149
版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。
添加新评论
暂无评论