Home > Article > Operation and Maintenance > How to temporarily change IP and permanently change IP in centos7
The content of this article is about how to temporarily modify the IP and permanently modify the IP in centos7. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
ifconfig eno16777736 192.168.1.101
Note (eno16777736) is the default first network interface name
Step one: Check the network interface
ifconfig
Step two: Go to the corresponding network interface configuration file to modify the configuration, please note The file name is (ifcfg-default first network interface name), and the file path is /etc/sysconfig/network-scripts/
vim /etc/sysconfig/network-scripts/ifcfg-network interface name
Modify the following configuration
TYPE=Ethernet
BOOTPROTO=static
##DEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noNAME=eno16777736 UUID=9e8d604f-d991-4aa2-88a3-4c679e6f139cDEVICE=eno16777736ONBOOT=yesPEERDNS=yesPEERROUTES=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yes
HWADDR=00:0c:29:ce:3f:3c #MAC address
IPADDR=192.168.1.104 #STATIC IP
GATEWAY=192.168.1.2 #Default Gateway
NETMASK=255.255.255.0 #Subnet mask
DNS1=192.168.1.2 ##OthersDEVICE=Physical device name
IPADDR=IP address
NETMASK=Mask value
BROADCAST=Broadcast address
GATEWAY=Gateway address
ONBOOT=[yes|no](Whether to activate the device during boot)
USERCTL=[yes|no](Not Whether the root user can control the device)
BOOTPROTO=[none|static|bootp|dhcp] (Do not use the protocol when booting|static allocation|BOOTP protocol|DHCP protocol)
HWADDR= You MAC address
The above is the detailed content of How to temporarily change IP and permanently change IP in centos7. For more information, please follow other related articles on the PHP Chinese website!