Ubuntu10.10设置固定ip

来源:互联网 发布:个人记帐软件 编辑:程序博客网 时间:2024/06/05 11:32

本文以将当前获得的动态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

原创粉丝点击