Configure a nic for the centos server (linux and Automatic startup of the NIC)

Source: Internet
Author: User
Tags centos server

On the centos server, configure a NIC configuration (linux and automatic Nic startup). The NIC configuration file is stored in the directory:/etc/sysconfig/network-scripts/specific configuration file: ifcfg-xxx; for example, eth0 is a ifcfg-eth0, lo is ifcfg-lo # Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) TYPE = Ethernet # network adapter type device = eth0 # network adapter Interface Name ONBOOT = yes # Whether to automatically load when the system starts. yes, it is automatically loaded when the system starts, no boot does not load BOOTPROTO = static # enable address protocol -- static: static protocol -- bootp protocol -- dhcp protocol IPADDR = 172.16.13.3 # Nic IP address, write your own information. NETMASK = 255.255.0.0 # Nic network address GATEWAY = 172.16.254.254 # Nic gateway address DNS1 = 172.16.254.254 # Nic DNS address HWADDR = 00: 0C: 29: 13: 5D: 74 # Nic device MAC address BROADCAST = 192.168.1.255 # Nic BROADCAST address command:/etc/init. d/network reload Nic interface disable and activate ifdown eth0 # disable network ifup eth0 # Start and disable network services Method 1: service network start | stop | status | restart | reload | force-reload Method 2:/etc/init. d/network start | stop | status | restart | reload | force-reload start: View All Nic information. The information displayed includes the enabled nic and all NICs. For example, [root @ reage etc] # service network status Configured devices: lo eth0 eth1 Currently active devices: lo eth0 restart: restart the NIC service. The NIC service is disabled first. Then, when the NIC information reload is Enabled: reload the NIC configuration file. After the NIC configuration file is modified and saved, it does not take effect. You need to load it To the memory in this way, start, stop, and status only load the memory configuration information force-reloal: Unknown Function temporary Nic configuration information, no need to restart. [Root @ reage ~] # Ifconfig eth0 172.16.13.3 netmask 255.255.0.0 additional topic: view the MAC of the VM Nic Source: http://blog.csdn.net/rentiansheng/article/details/8877367

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.