Ubuntu網(wǎng)卡IP設(shè)置
作者:佚名
本文主要是教大家如何在Ubuntu系統(tǒng)下設(shè)置網(wǎng)卡的IP地址,相信對于許多使用Ubuntu系統(tǒng)的新手來說應(yīng)該會有很大的幫助!
Ubuntu里網(wǎng)卡IP設(shè)置的步驟:
1.單網(wǎng)卡配單IP(普遍)
- vi /etc/network/interface
- auto eth0
- iface eth0 inet static
- address IP
- netmask 子網(wǎng)掩碼
- gateway 網(wǎng)關(guān)
2.單網(wǎng)卡雙IP (情況較少,多用于區(qū)分服務(wù)或者安全隱藏)
- vi /etc/network/interface
- auto eth0:0
- iface eth0:0 inet static
- address IP
- netmask 子網(wǎng)掩碼
- gateway 網(wǎng)關(guān)
- auto eth0:1
- iface eth0:1 inet static
- address IP
- netmask 子網(wǎng)掩碼
- gateway 網(wǎng)關(guān)
3.雙網(wǎng)卡雙IP(應(yīng)用情況較多,一般為一個(gè)內(nèi)網(wǎng)一個(gè)為外網(wǎng))
- auto eth0
- iface eth0 inet static
- address IP
- netmask 子網(wǎng)掩碼
- gateway 網(wǎng)關(guān)
- auto eth1
- iface eth1 inet static
- address IP
- netmask 子網(wǎng)掩碼
- gateway 網(wǎng)關(guān)
綜上,配置后保存推出,一般需要重啟下網(wǎng)卡才能設(shè)置生效,方法很多,比如ifdown eth0 ,ifup eth0,最直接的方法直接在終端鍵入/etc/init.d/networking restart www.kissgz.com
至于DNS,都是一樣的,如下
- vi /etc/resolv.conf(實(shí)際系統(tǒng)默認(rèn)的并不存在resolv.conf該文件,屬于自己創(chuàng)建)
- nameserver 主DNS
- nameserver 后備DNS
【編輯推薦】
責(zé)任編輯:馮宇
來源:
ChinaUnix文檔頻道