RedHatEnterpriseLinux5 Nic Configuration

Source: Internet
Author: User
The NIC configuration file is in the RedHatenterpriselinux system. Each network medium corresponds to a configuration file, which allows the Super User to configure the NIC. These configuration files are called Nic configuration files (NICConfigureFile). Nic configuration files must be saved in/etc/sysconfig/network-scripts/, and their file names must comply with the following format: & n

Nic configuration file

In RedHat enterprise linux, each network medium corresponds to a configuration file, which allows the Super User to configure the NIC. These configuration files are called NIC configuration files ).

The NIC configuration file must be saved in/etc/sysconfig/network-scripts/, and the file name must comply with the following format:

Ifcfg-NIC

The NIC is the Identification name of the NIC. The following is the NIC configuration file saved in my/etc/sysconfig/network-scripts/directory.

You can define the gateway parameter in the NIC configuration file and/etc/sysconfig/network. If both files set this parameter, the gateway parameter value in the NIC configuration file overwrites the gateway value in/etc/sysconfig/network.

Enable and disable NICs

Ifup/ifdown

Network SERVICE

System-config-network

1. ifup and ifdown are shell scripts developed by Red Hat and provided to red hat enterprise linux to manage Nic applets. You can use ifup and ifdown to start or stop the red hata enterprise linux Nic. If you want to start the network card, use ifup; to stop a network card, use ifdown

The syntax of ifup and ifdown is as follows:

Ifup NIC

Ifdown NIC

The NIC parameter after ifup and ifdown is the name of the NIC you want to start or stop.

2. network

The second method to start and stop NICS is through a service called network, which initializes the network environment of red hat enterprise linux. The network service is counted as an independent system service in red hat enterprise linux. Therefore, you can directly use the service command to start or stop the network service.

When the network service is started in red hat enterprise linux, the network service reads the files stored in the/etc/sysconfig/network-scripts/directory file named ifcfg-NIC in sequence, that is, all Nic configuration files. If onboot in ifcfg-NIC is set to yes, the network service calls the ifup tool to start the NIC. When the onboot parameter in ifcfg-NIC is set to no, the network skips the start of this Nic. When the network service is stopped, the network service also disables these NICs one by one through ifdown based on all Nic configuration files.

In addition, the network service initializes network configurations such as route tables and default gateways. Generally, the network service is cleaner and more correct than the ifup/ifdown tool. We strongly recommend that you use the network service to reset the network environment of red hat enterprise linux.

Comparison between ifup/ifdown and network services

Ifup/ifdown is suitable for starting or stopping a network card, while the network service is suitable for rebuilding the red hat enterprise linux network environment. For example, if you only modify the IP address of a network card, you can use ifdown to stop the network card and then use ifup to restart it. However, if you modify the default gateway, you have to restart the network service.

In addition, if you use ifup/ifdown to modify the configuration of a nic, the correct steps are as follows:

1. Disable Nic

2. Modify the NIC configuration file

3. Enable the NIC.

If the above steps are violated, it is likely that the NIC will still use the old setting value. Now, you can restart the network service to re-build the network environment of red hat enterprise linux.

P.S.

The NIC information specified by ifconfig is used. Because its configuration only exists in the memory, the specified information disappears after the machine is restarted. Therefore, to thoroughly change the NIC information, you must modify the NIC configuration information.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.