Linux設定靜態IP

2021-10-01 02:14:14 字數 826 閱讀 3419

步驟一:

終端進入ifcfg-eth0

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

步驟二:
device = eth0 裝置名稱(預設)

hwaddr = 00:0b:28:d3:bb:e5 mac位址(預設)

type = ethernet 網路設定(預設)

onboot = yes 開機自啟動(必須有)

mm_controlled = yes

bootproto = static 靜態ip(必須有)

dns1 = 192.168.1.1 dns(必須有)

ipv6init = no

userctl = no

ipaddr = 192.168.1.11 ip位址(必須有,根據自己的寫)

netmask = 255.255.255.0 子網掩碼(必須有)

gateway = 192.168.1.1 閘道器(必須有)

步驟三:

重啟網路服務

service network restart

或者/etc/init.d/network restart

步驟四:

測試,ping閘道器…能ping通則說明網路正常

ping 192.168.1.1

linux設定靜態ip

安裝linux之後,一般都會設定nat聯網模式,此時沒有為centos分配ip位址為系統分配ip有兩種方法。type ethernet hwaddr 00 0c 29 3f 79 46 nm controlled yes bootproto static name ens33 uuid 37566c...

linux靜態ip設定

vim etc sysconfig network scripts ifcfg enp1s0修改為以下內容 type ethernet proxy method none browser only no name enp1s0 uuid 2f66bc1d 3916 46c9 aedd 30cc5dc...

Linux 設定靜態IP

ubuntu下修改靜態ip 開啟 etc network inte ces檔案,修改為以下內容 auto eth0 iface eth0 inet static address 172.30.1.network 255.255.0.0 gateway 172.30.1.1 新增dns位址,開啟 et...