Original link:
Centos6.5 quick configuration of available network cards
After the installation is complete, we start our system, at this time our system, is no network, IP device, and is not activated, if we use the Ifconfig command to view the IP address, we will find that the address is 127.0.0.1, we need to enter into Cd/etc/sysconfig /network-scripts/directory, modify the IP device of Ifcfg-eth0, before we get to know, have knowledge about network configuration.
One, network-related files: 1)/etc/sysconfig/network set host name and can start NETWORK2)/etc/sysconfig/network-scripts/ifcfg-eth0 Set the file for the NIC parameter 3)/etc/modprobe.conf to set the file to load the kernel module when booting 4)/etc/resolv.conf set the DNS IP (resolution Server) file 5)/etc/hosts Record the host name or host alias for the computer IP 6)/etc/protocols defines the data related to the IP packet protocol, including the definition of the packet protocol for ICMP, TCP, etc. network-related startup commands: 1)/etc/init.d/ Network restart can restart the entire network parameter 2) ifup eth0 (Ifdown eth0) to start or shut down a web interface, can be handled by simple script, These two script will be active to/etc/sysconfig/network-scripts/directory ifconfig query, set network card and IP network segment parameters Ifup/ifdown start/Shut Down network interface
Some instructions for the NIC parameters:
device=eth0//device name hwaddr=< Span class= "number" >00:0c:29: 73: 09:46//mac address type=ethernet/ /NIC protocol type uuid=096eb8aa-af16- 4032-a6b9-40d015ea663d//natively IP unique identity onboot=yes//whether boot, start, default is nonm_controlled= yes//whether to accept Networkmanage management (RHEL6 new network Management program, manage Ethernet, Bluetooth, wireless) bootproto=dhcp//static (manually specified address) | DHCP (dynamic FETCH)
Note that the default is Onboot=no, so the IP address will not be obtained, we can change it to Yes, and then restart the service, we can connect to the network.
Sometimes, if we don't have enough machines, we may need to install multiple CentOS systems in the virtual machine, and if we all install each one, it will be a waste of time, and in order to speed up, we can use the Clone command of the virtual machine to copy multiple virtual machine copies. To achieve the purpose of rapid installation, cloning, there are 2 kinds, one is a reference copy, the other is a completely independent copy, we generally use a separate copy, because we do not exist between the machine shared a disk or resources, that is very confusing. Cloning very easy, after we restart the system, the copy machine ip
OK, but the Clone machine network is not, at this time, we need to do the following to configure the clone machine's IP, delete the clone MAC address, and then change the device name eth1, Subsequent more copies of the machine can be configured according to this,
Modify the Ifcfg-etho configuration file as follows:
device=eth1 //device name, change, delete MAC address, restart retrieve IP address type=Ethernetuuid=096eb8aa-af16-4032-a6b9- 40d015ea663donboot=Yesnm_controlled=Yesbootproto=dhcp
Restart, and then use the Ifconfig command to view the IP address, you will find that the success has been achieved, at this time, we can also ping the network address, to detect the true configuration of the Internet is successful!
Centos6.5 quick configuration of available network cards