ubuntu網路設定

2021-08-20 02:23:23 字數 1644 閱讀 5428

ubuntu網路配置的常用系統,於是我學習研究了ubuntu網路配置,在這裡對大家詳細介紹下ubuntu網路配置應用,希望對大家有用ubuntu網路配置包含了非常好的翻譯和容易使用的架構./etc/network/inte***ces開啟後裡面可設定dhcp或手動設定靜態ip。前面auto eth0,讓網絡卡開機自動掛載.

1. 以dhcp方式配置網絡卡

編輯檔案/etc/network/inte***ces:sudo vi /etc/network/inte***ces

並用下面的行來替換有關eth0的行:

# the primary network inte***ce - use dhcp to find our address

auto eth0

iface eth0 inet dhcp

用下面的命令使網路設定生效:sudo /etc/init.d/networking restart也可以在命令列下直接輸入下面的命令來獲取位址sudo dhclient eth0

2. 為網絡卡配置靜態ip位址

編輯檔案/etc/network/inte***ces:sudo vi /etc/network/inte***ces並用下面的行來替換有關eth0的行:# the primary network inte***ce

auto eth0  

iface eth0 inet static  

address 192.168.3.90  

gateway 192.168.3.1  

netmask 255.255.255.0  

#network 192.168.3.0  

#broadcast 192.168.3.255 

將上面的ip位址等資訊換成你自己就可以了.用下面的命令使網路設定生效:sudo /etc/init.d/networking restart

3. 設定第二個ip位址(虛擬ip位址)

編輯檔案/etc/network/inte***ces:sudo vi /etc/network/inte***ces

在該檔案中新增如下的行:

auto eth0:1  

iface eth0:1 inet static  

address 192.168.1.60  

netmask 255.255.255.0  

network x.x.x.x  

broadcast x.x.x.x  

gateway x.x.x.x 

根據你的情況填上所有諸如address,netmask,network,broadcast和gateways等資訊.用下面的命令使網路設定生效:sudo /etc/init.d/networking restart

4. 設定主機名稱(hostname)

5. 配置dns

首先,你可以在/etc/hosts中加入一些主機名稱和這些主機名稱對應的ip位址,這是簡單使用本機的靜態查詢.要訪問dns 伺服器來進行查詢,需要設定/etc/resolv.conf檔案.假設dns伺服器的ip位址是192.168.3.2, 那麼/etc/resolv.conf檔案的內容應為:

search test.com

nameserver 192.168.3.2

以上介紹ubuntu網路配置。

**:

ubuntu網路設定

主要檔案 etc network inte ces,這裡是ip 閘道器 掩碼等的一些配置 etc resolv.conf這個檔案儲存dns的有關資訊 主要命令 sudo etc init.d networking restart重啟網路,使配置檔案的配置生效 通過配置檔案配置 1 配置ip閘道器 s...

ubuntu網路設定

a,ubuntu系列網路配置資訊儲存在 etc network inte ces中 b,dns資訊儲存在 ect resolv.conf中.note 如果只是臨時性的改變ip位址,則不用修改inte ces檔案,只用ifconfig即可,不過當系統重啟後,系統會恢復inte ces中的配置.ifco...

ubuntu 設定網路

1.以dhcp方式配置網絡卡 編輯檔案 etc network inte ces sudo vi etc network inte ces 並用下面的行來替換有關eth0的行 the primary network inte ce use dhcp to find our address auto ...