找回密碼
 註冊
搜索
查看: 3922|回復: 0

[Ubuntu] 設定網卡IP及DNS

[複製鏈接]
發表於 2011-8-30 15:02:12 | 顯示全部樓層 |閱讀模式
1.1 設定單網卡單IP
vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254

1.2 單網卡多IP
vi /etc/network/interfaces
auto eth0:0
iface eth0:0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254

auto eth0:1
iface eth0:1 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.254  

1.3 自動取得IP
vi /etc/network/interfaces
auto eth0
iface eth0 inet dhcp

2.設定DNS
vi /etc/resolv.conf
nameserver 168.95.192.1

3.重新啟動網路服務
/etc/init.d/networking restart
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|彩色筆小沛的知識庫

GMT+8, 2024-12-22 16:04 , Processed in 0.011970 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表