Home Operation and Maintenance CentOS How to set ip address in centos7

How to set ip address in centos7

May 23, 2020 pm 03:04 PM
centos7 IP address

How to set ip address in centos7

First open the ifcfg-eth0 file

# vim /etc/sysconfig/network-scripts/ifcfg-eth0
Copy after login

Then modify the following content

BOOTPROTO="static" #dhcp改为static   
ONBOOT="yes" #开机启用本配置  
IPADDR=192.168.7.106 #静态IP  
GATEWAY=192.168.7.1 #默认网关  
NETMASK=255.255.255.0 #子网掩码  
DNS1=192.168.7.1 #DNS 配置
Copy after login

Finally restart the network service

# service network restart
Copy after login

Recommended tutorial: centos tutorial

The above is the detailed content of How to set ip address in centos7. For more information, please follow other related articles on the PHP Chinese website!

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to set Xiaohongshu not to display IP address? How does it change the id to locate the city? How to set Xiaohongshu not to display IP address? How does it change the id to locate the city? Mar 27, 2024 pm 03:00 PM

How to set Xiaohongshu not to display IP address? How does it change the id to locate the city?

CentOS7 various version image download addresses and version descriptions (including Everything version) CentOS7 various version image download addresses and version descriptions (including Everything version) Feb 29, 2024 am 09:20 AM

CentOS7 various version image download addresses and version descriptions (including Everything version)

Where is the IP address of Xiaomi mobile phone? Where is the IP address of Xiaomi mobile phone? Feb 29, 2024 pm 06:10 PM

Where is the IP address of Xiaomi mobile phone?

Where to change the IP address of Xianyu_Share how to change the IP address of Xianyu Where to change the IP address of Xianyu_Share how to change the IP address of Xianyu Mar 20, 2024 pm 05:06 PM

Where to change the IP address of Xianyu_Share how to change the IP address of Xianyu

How to change the location of Douyin IP address? Why does the IP address change location? How to change the location of Douyin IP address? Why does the IP address change location? Mar 21, 2024 pm 06:30 PM

How to change the location of Douyin IP address? Why does the IP address change location?

Steps to enter CentOS 7 emergency repair mode Steps to enter CentOS 7 emergency repair mode Jan 13, 2024 am 09:36 AM

Steps to enter CentOS 7 emergency repair mode

Bitcoin transaction IP address (Is the Bitcoin transaction IP address public?) Bitcoin transaction IP address (Is the Bitcoin transaction IP address public?) Feb 06, 2024 am 10:03 AM

Bitcoin transaction IP address (Is the Bitcoin transaction IP address public?)

Where can I change the printer's IP address? Tutorial on changing printer IP address Where can I change the printer's IP address? Tutorial on changing printer IP address Mar 13, 2024 pm 10:16 PM

Where can I change the printer's IP address? Tutorial on changing printer IP address

See all articles