Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the IP and startup configuration file of the CentOS operating system network card

Shulou Source: shulou.com Published: 2022-06-01 07:15:26 11月14日 Update

This article will explain in detail about CentOS operating system network card IP and startup configuration file, the content of the article is of high quality, so the editor will share it for you to do a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

After studying CentOS network card for a long time, you may encounter the problem of CentOS network card. Here we will introduce the solution to the problem of CentOS network card. The IP address of CentOS network card is stored in the file, and the IP configuration file of this CentOS network card is under / etc/sysconfig/network-scripts.

The names are ifcfg-eth0,ifcfg-eth2.... If you have a CentOS network card IP, there is only one file ifcfg-eth0. If you have two or more CentOS network cards IP, there will be ifcfg-eth2, ifcfg-eth3 and other files.

File structure:

DEVICE=eth0 / / indicate the device name

BOOTPROTO=static// startup type dhcp,dcph or static automatic and manual

BROADCAST=192.168.1.255 / / broadcast address

HWADDR=00:06:5B:FE:DF:7C// hardware Mac address

IPADDR=192.168.0.2//IP address

NETMASK=255.255.255.0 / / subnet mask

NETWORK=192.168.0.1 / / Network address

ONBOOT=yes / / whether to start the application

TYPE=Ethernet / / Network Typ

1 vi / etc/sysconfig/network-scripts/ifcfg-teh0

2. Start the service service network restartCentOS network card editing host DNS server information command: vim / etc/resolv.confCentOS network card editing content is (comment out the second line): nameserver 202.118.176.2

About the CentOS operating system network card IP and startup configuration file is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Network card file address configuration content operating system system name article more knowledge article type network problem service good host information only Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info macOS MariaDB vpn Shulou Information