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