Step 1 Use the KVM to assign an IP address to the network adapter by modifying the configuration file.
Step 2 Run the following command to restart the network service:
service network restart
The restart fails. For details, see the following figure.
Step 3 Check whether the network routes are normal.
Run the ping
command to check whether the routes are normal. The message "Network is unreachable" is displayed.
Step 4 Use the GUI-based management tool to assign IP addresses.
In the upper right corner of the GUI, it can be found that the network adapter is not connected. After assigning IP addresses, run the service network restart
command. The same error message is displayed.
For details, see the following figure.
The solution is simple. You only need to close the NetworkManager service.
Step1 Check whether the NetworkManager service is enabled.
The name of the NetworkManager service varies with the system version. You can run the chkconfig --list command to view the name.
Step 2 Disable the NetworkManager service.
Run the following command to stop the activated service:
service NetworkManager stop
Run the following command to disable automatic service startup:
chkconfig NetworkManager off
Step 3 Use a script to configure IP addresses.
In a Red Hat operating system, the Network service is used when IP addresses are configured using the /etc/network/interfaces script, and the NetworkManager service is used when IP addresses are configured on a GUI.
The relationship between the Network service and the NetworkManager service is as follows:
• If no NetworkManager is available, the system uses the Network service for network configuration by default.
• If NetworkManager is enabled, it takes over the system's network configuration by default. In this case, you need to use the network configuration parameters of the NetworkManager service. NetworkManager applies to desktop environments, such as laptop computers.
The Network service and the NetworkManager service cannot coexist. To avoid conflicts and share configurations, the following solution is implemented:
• When detecting that the /etc/network/interfaces is changed, NetworkManager closes itself (displayed as unhosted) unless its related flag bit is set to true.
• When the related flag bit of NetworkManager is set to true, /etc/network/interfaces does not take effect.
Starting from Red Hat 6, the NetworkManager service is enabled by default. If so, modifying the script to configure IP addresses is invalid unless the related flag bit is set to no.
For example, an IP address configured using DHCP is in the following format:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
The flag bit of the NetworkManager service varies with different systems. For example, in Ubuntu, the flag bit is stored in the /etc/NetworkManager/nm-system-settings.conf configuration file, and the name is managed.
After modifying the configuration file, you must restart the NetworkManager service.
In the current case, the NetworkManager service is enabled by default. The details are as follows:
[root@localhost ~]# chkconfig|grep -i network
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
In this case, enabling the Network service does not take effect. Therefore, restarting the network service fails.
Before establishing an iSCSI connection between a Red Hat operating system and a storage system, you need to determine the service type enabled on the host. If both NetworkManager and Network are enabled, disable NetworkManager.