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; if eth0 is ifcfg-eth0, lo is ifcfg-lo # intelconfiguration82545emgi... 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 # Nic type device = eth0 # Nic interface name ONBOOT = yes # whether to automatically load when the system starts, yes Boot automatically loaded, 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, enter 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 | rest Art | reload | force-reload Method 2:/etc/init. d/network start | stop | status | restart | reload | force-reload start: start the Nic service and enable all self-starting NICs stop: disable all NICs, currently enabled NIC status: 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 additional topic of netmask 255.255.0.0: view the MAC of the VM Nic Source: http://blog.csdn.net/rentiansheng/article/details/8877367
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.