How to temporarily change IP and permanently change IP in centos7

坏嘻嘻
Release: 2018-09-17 10:24:01
Original
5374 people have browsed it

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.

Temporarily modify IP

ifconfig eno16777736 192.168.1.101

Note (eno16777736) is the default first network interface name

Permanently modify the IP

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=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

NAME=eno16777736

UUID=9e8d604f-d991-4aa2-88a3-4c679e6f139c

DEVICE=eno16777736

ONBOOT=yes

PEERDNS=yes

PEERROUTES=yes

IPV6_PEERDNS=yes

IPV6_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

NETWORK=Network address

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template