ubuntu16 04修改網絡卡資訊

2021-08-20 12:58:37 字數 674 閱讀 8198

檢視網絡卡資訊和名稱

ip a

方法一:開啟配置檔案(記得配置完重啟並ping一下)

sudo vim /etc/network/inte***ce

輸入以下內容:

# the loopback network inte***ces

auto lo

iface lo inet loopback

# the primary network inte***ce

auto ens33

iface ens33 inet static

address 10.10.10.10

netmask 255.255.255.0

gateway 10.10.10.2

dns-nameserver 223.5.5.5

auto ens38

iface ens38 inet manual

auto ens39

iface ens39 inet manual

方法二:直接修改

sudo ifconfig ens33 192.168.2.1 netmask 255.255.255.0

最後都要重啟網絡卡

sudo /etc/init.d/networking restart

注:網絡卡名稱根據實際改變,比如我的網絡卡名稱就是ens33

ubuntu16 04配置網絡卡

第一步 檢視網絡卡資訊 輸入ifconfig命令檢視網絡卡資訊,下圖紅圈處就是網絡卡名稱。第二步 配置網絡卡檔案 注意 不同的linux系統,網絡卡配置檔案是不同的,這裡ubuntu的網絡卡配置檔案是 etc network inte ces。輸入下面命令進行編輯網絡卡檔案 sudo vi etc ...

ubuntu16 04配置網絡卡

第一步 檢視網絡卡資訊 輸入ifconfig命令檢視網絡卡資訊,下圖紅圈處就是網絡卡名稱。注意 不同的linux系統,網絡卡配置檔案是不同的,這裡ubuntu的網絡卡配置檔案是 etc network inte ces。輸入下面命令進行編輯網絡卡檔案 sudo vi etc network inte...

Ubuntu16 04配置網絡卡

配置網絡卡檔案 注意 不同的linux系統,網絡卡配置檔案是不同的,這裡ubuntu的網絡卡配置檔案是 etc network inte ces。輸入下面命令進行編輯網絡卡檔案 sudo vi etc network inte ces 預設的檔案內容如下 auto lo iface lo inet ...