您的位置:首页 > 其它

Ubuntu10.10设置固定ip

2012-02-24 10:57 274 查看
本文以将当前获得的动态ip地址设为固定ip为例

首先,检查现有的ip地址:

ifconfig

在etho有这么一行:

inet addr:172.20.14.30 Bcast:172.20.14.255 Mask:255.255.255.0

将其记录下来

修改ip地址配置文件:

vi /etc/network/interfaces

试用动态ip的配置文件:

# The primary network interface

auto eth0

iface eth0 inet dhcp

将其修改为:

# The primary network interface

iface eth0 inet static

address 172.20.14.30

network 172.20.14.0

netmask 255.255.255.0

gateway 172.20.0.1

保存后重启网络:

sudo /etc/init.d/networking restart
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: