当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > Ubuntu Linux系统下设置静态IP的方法

Unix/Linux
HP工程师经验分享(34)
HP工程师经验分享(33)
HP工程师经验分享(32)
HP工程师经验分享(31)
HP工程师经验分享(30)
HP工程师经验分享(29)
HP工程师经验分享(28)
HP工程师经验分享(27)
HP工程师经验分享(26)
HP工程师经验分享(25)
HP工程师经验分享(24)
HP工程师经验分享(2)
HP工程师经验分享(23)
HP工程师经验分享(22)
HP工程师经验分享(21)
HP工程师经验分享(20)
HP工程师经验分享(19)
HP工程师经验分享(18)
HP工程师经验分享(17)
HP工程师经验分享(16)

Unix/Linux 中的 Ubuntu Linux系统下设置静态IP的方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-15   浏览: 158 ::
收藏到网摘: n/a

Ubuntu的网络参数保存在文件 /etc/network/interfaces中,默认设置使用dhcp,内容如下:

# The primary network interface

auto eth0

iface eth0 inet dhcp

 

设置静态ip的方法如下:

(1)编辑 /etc/network/interfaces

1.1)将dhcp 一行屏蔽

# The primary network interface

auto eth0

#iface eth0 inet dhcp

 

1.2)添加和静态ip有关的参数

# The primary network interface

iface eth0 inet static

address 192.168.0.10

netmask 255.255.255.0

gateway 192.168.0.1

 

nameserver 202.96.134.133

nameserver 202.106.0.20

 

(3)执行下面两个命令,启用新设置

$sudo ifdown eth0

$sudo ifup eth0