糯米文學吧

位置:首頁 > 計算機 > 操作系統

Ubuntu Linux系統下設置Static IP的方法

Ubuntu的網絡參數保存在文件 /etc/network/interfaces中,默認設置使用dhcp,內容如下:

Ubuntu Linux系統下設置Static IP的方法

# 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

netmask

gateway

(2)編輯 /etc/,設置dns

nameserver

nameserver

(3)執行下面兩個命令,啟用新設置

$sudo ifdown eth0

$sudo ifup eth0