CentOS Start and disable network card commands

Source: Internet
Author: User

Ifup, Ifdown:linux command

Real-time manual modification of some network interface parameters, you can use ifconfig to achieve, if you want to directly to the configuration file, in the/etc/sysconfig/network-scripts inside the IFCFG-ETHX and other files set parameters to start, It has to be done through Ifdown or ifup.

[Root@linux ~]# ifup {interface}/Start Network card command
[Root@linux ~]# Ifdown {interface}//disable network card command
[Root@linux ~]# ifup eth0/start Nic Eth0

Ifup and Ifdown are just too easy. These two programs are actually script, it will go directly to the/etc/sysconfig/network-scripts directory to search for the corresponding configuration file, such as Ifup eth0, it will find ifcfg-eth0 the contents of the file, and then set.

However, since these two programs are primarily the search settings file (IFCFG-ETHX) for startup and shutdown, make sure that the IFCFG-ETHX exists in the correct directory before using it, or it will fail to start. In addition, if you set or modify the network interface with Ifconfig eth0, you can no longer shut down in Ifdown eth0 mode. Because Ifdown will analyze compare current network parameter and ifcfg-eth0 whether match, do not match, will abandon this operation. Therefore, after the use of ifconfig modified, should be ifconfig eth0 down to be able to close the interface.

Linux every time you start the network card must be activated to the Internet, it is very troublesome.
VI Editor Open the following file
# Vi/etc/sysconfig/network-scripts/ifcfg-eth0:1//view eth0:1 configuration file.
All said that there is onboot=yes this sentence can start automatic activation, but the configuration file clearly has or did not work, the boot is always manually to activate.
So add in the/etc/rc.d/rc.local file

Ifup eth0

Or

Ifconfig eth0 up//enable NIC Eth0

Ifconfig eht0 down//off NIC Eth0



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.