Linux設定靜態ip教程

2021-09-13 17:50:52 字數 456 閱讀 4728

1、檢視網絡卡名稱:ip addr (查出網絡卡名稱為ens33)

2、配置網絡卡資訊:vi /etc/sysconfig/network-scripts/ifcfg-ens33

配置資訊如下:

device=ens33 #要配置的網絡卡名稱

onboot=yes #網絡卡開機自啟動

bootproto=static #靜態ip方式

ipaddr=192.168.2.7 # ipv4位址

gateway0=192.168.189.2 #設定閘道器

dns1=115.156.76.144       #設定主dns

dns2=114.114.114.114 #設定備用dns

3、重啟網路服務

systemctl restart network 或者 service network restart #重啟網路

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...