ubuntu设置静态ip

桌面版可以图形化设置静态ip,本文是在字符界面下如何设置静态ip:

1、修改/etc/network/interfaces文件,添加ip设置参数:

sudo vi /etc/network/interfaces

添加:

auto eth0
iface eth0 inet static
address 192.168.1.109
netmask 255.255.255.0
gateway 192.168.1.103

其余代码注释掉。

2、修改/etc/resolv.conf文件,设置dns:

sudo vi /etc/resolv.conf

添加:

nameserver 202.99.160.68
nameserver 202.99.166.4

3、重启网卡

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据