centos下網路的配置

2021-09-20 05:48:30 字數 452 閱讀 2822

1、網路模式要進行使用nat,要連網的話,要配置好設定:網路要進行一下共享到虛擬機器

進入vi /etc/sysconfig/network-scripts/ifcfg-eth0

把裡面的onboot=no改為onboot=yes

bootproto=dhcp改為bootproto=static

再加上如下幾行:

ipaddr=192.168.137.22

netmask=255.255.255.0

gateway=192.168.137.1這個是共享的那個ip

dns1=8.8.8.8

dns的配置,進入:vi /etc/resolv.conf

增加一行:nameserver 192.168.137.1

儲存退出。

配置好之後要重新啟動一下,

service network restart

CentOS 命令列下網路配置

注 此方法適用於永久配置網路資訊 1 檢視網絡卡資訊 ifconfig 2 配置ip vi etc sysconfig network scripts ifcfg eth0 device eth0 網絡卡編號 bootproto static 靜態ip或者dhcp動態獲取。靜態 static 動態 ...

ubuntu下網路配置

ubuntu 系統配置檔案在 etc network inte ces 編輯配置檔案 sudo vi etc network inte ces 在為配置之前有 1 auto lo 2 iface lo inet loopback 將這兩行注釋掉 我這邊的路由器位址是192.168.1.1 因此配置為...

vituralbox下網路配置

1 設定virtualbox為橋接模式 img 2 橋接模式使得宿主機和虛擬機器在同乙個網段內工作 img 並做如下引數調整 img 3 設定dns伺服器 通過如下命令設定dns伺服器 vi etc resolv.conf img 4 關閉虛擬機器防火牆 service iptables stop ...