歡迎您光臨本站 註冊首頁

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

←手機掃碼閱讀     火星人 @ 2014-03-12 , reply:0
  

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

 

(2)編輯 /etc/resolv.conf,設置dns

nameserver 202.96.134.133

nameserver 202.106.0.20

 

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

$sudo ifdown eth0

$sudo ifup eth0

 

(責任編輯:A6)



[火星人 ] Ubuntu Linux系統下設置Static IP的方法已經有361次圍觀

http://coctec.com/docs/net/show-post-68364.html