Ifup and ifdown: linux commands can manually modify some network interface parameters in real time, which can be implemented using ifconfig. if you want to directly use the configuration file, that is, if you start the ifcfg-ethx and other file setting parameters in/etc/sysconfig/network-scripts, you need to implement ifdown or ifup. [Root @ linux ~] # & N
Ifup and ifdown:Linux Commands
You can use ifconfig to manually modify network interface parameters in real time, that is, if you start the ifcfg-ethx and other file setting parameters in/etc/sysconfig/network-scripts, you need to implement ifdown or ifup.
[Root @ linux ~] # Ifup {interface}
[Root @ linux ~] # Ifdown {interface}
[Root @ linux ~] # Ifup eth0
Ifup and ifdown are too simple. These two programs are actually scripts. they will directly search for the corresponding configuration files in the/etc/sysconfig/network-scripts directory, such as ifup eth0, it will find the contents of the ifcfg-eth0 file and then set it. For more information about how to set up a ifcfg-eth0, see the instructions for connecting to the Internet in the previous chapter.
However, because these two programs mainly start and close the settings file ifcfg-ethx, therefore, before use, make sure that ifcfg-ethx exists in the correct directory. Otherwise, the startup will fail. In addition,If you use ifconfig eth0 to set or modify the network interface, you cannot disable it in ifdown eth0 mode. Because ifdown will analyze and compare the current network parameters and ifcfg-eth0 is consistent, if not, will give up this operation. Therefore, you must use ifconfig eth0 to disable the ifconfig eth0 operation after the ifconfig modification is complete.
When linux starts, the NIC must be activated to access the Internet.
I searched for information online and finally solved the problem as follows:
# Vi/etc/sysconfig/network-scripts/ifcfg-eth0: 1 view the configuration file of eth0: 1.
It is said that ONBOOT = yes can enable automatic activation upon startup, but it still does not work in the configuration file, and manual activation is always required for boot.
Add the following content to the/etc/rc. d/rc. local file:
Ifup eth0
Or
Ifconfig eth0 up
Eth0 is the network card to be activated. in my system, eth0: 1 is used, so ifup eth0: 1 is used.