Add a network card to the CentOS system

Source: Internet
Author: User

After we have added the hardware, we can view the specific network in the configuration file/etc/udev/rules.d/70-persistent-net.rules

Card serial Number The rest of the network adapter configuration steps are not changed, can refer to the following:


Network mode: Bridge mode, Nat mode

1.1, bridge mode is in the network environment in the presence of routers, you can support DHCP to obtain IP (command dhclient), the steps are similar to NAT;

1.2, the NAT mode is through the network of the real machine to the Internet, here does not need to set up the real computer network card sharing, also can support

Dhclient command to obtain the IP address and gateway, write the acquired IP address with the gateway to the configuration file/etc/sysconfig/network-

Scripts/ifcfg-eth0 (for Eth0 NIC).


Nat Mode configuration steps:


1. Set the network mode of the virtual machine to NAT mode;


2, open the configuration file/etc/sysconfig/network-scripts/ifcfg-eth0, see if Bootproto is DHCP,

If not, please change it to DHCP, only in order to effectively use the command dhclient;


3, use the command dhclient to obtain the IP address, subnet mask and gateway address, write the configuration

/etc/sysconfig/network-scripts/ifcfg-eth0, and change the Bootproto to static to permanently save the obtained

Take the IP and gateway, at the same time change the onboot to Yes, so that it starts with the boot, so long as the network environment is not changed, you do not have to open the machine

Reconfigure IP;


4, at the same time in the configuration file, but also to write to the DNS address, or can not be connected to the extranet: dns1= Gateway address dns2= Network

The DNS address of the network (such as the DNS for mobile CMCC in Jiangxi Province is 221.176.4.9);


5, if not the Internet, the gateway address is wrong, at this time we can use the command route-n to see the net

Off with the IP, which shows which is written.


6, restart Network services: Service network Restart, you can ping the outside network.


This article is from "The Miracle Teenager" blog, please be sure to keep this source http://raffaelexr.blog.51cto.com/8555551/1766880

Add a network card to the CentOS system

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.