centos配置IP

vsphere client中数据模板创建的虚拟机

配置静态IP:

#网络配置文件
vi  /etc/sysconfig/network-scripts/ifcfg-ens192

 

#网卡类型

TYPE="Ethernet" 

#静态ip |不使用协议| bootp协议| dhcp协议

BOOTPROTO="static" #【static | none | bootp | dhcp】

 #物理设备名

DEVICE="ens192"

#重启网卡是否激活网卡设备

ONBOOT="yes" #yes | no 

 #IP地址

IPADDR=192.168.1.123

 #子网掩码

NETMASK=255.255.255.0

#网关地址

GATEWAY=192.168.1.1 

#首选DNS 

DNS1=192.168.60.30

#备用DNS

DNS2=223.5.5.5

 

修改完成,退出

#重启网卡

systemctl restart network.service

posted @ 2022-03-08 14:49  0x小希  阅读(159)  评论(0)    收藏  举报