Linux (CentOs6.3) network configuration


The newly installed virtual machine is often unable to connect to the network. This article describes how to configure network information on the CentOs6.3 system

1. Press the shortcut key windows+r under the windows system, enter cmd and confirm, open a black window

2. Enter ipconfig in the black window and press Enter

3. Record the ipv4 address and default gateway under VMnet8, as shown below

After the VMware software is installed, the operating system will virtualize two virtual network cards, VMnet1 and VMnet8

4. Enter the command in the virtual machine and press Enter

vim /etc/sysconfig/network-scripts/ifcfg-eth0

5. Enter the following information in this file, save and exit

  1. BOOTPROTO=none---------------- means to set a static ip address
  2. HWADDR------------------------MAC address of the network card, do not need to be modified, keep the default
  3. NM_CONTROLLED-----Whether the device eth0 can be managed by the Network Manager graphical management tool, it does not need to be changed by default
  4. ONBOOT=yes--------------------Whether the boot is started, fill in yes
  5. TYPE=Ethernet-----------------Network type, do not need to change
  6. UUID----------------------------No need to change
  7. IPADDR------------------------Virtual machine ip address (according to the information of vmnet8 recorded above, fill in the ip address of the same network segment as the default gateway, such as 192.168 .25.3, but do not fill in that 192.168.25.11 is already occupied. If you have installed multiple virtual machines, remember that the ip addresses of each machine should not be repeated)
  8. NETMASK-------------Subnet mask, fill in 255.255.255.0
  9. Gateway address -----------------------Fill in the information seen in vmnet8, I will fill in 192.168.25.2
  10. IPV6INIT---------------------Whether ipv6 is prohibited, the default is fine, don't care
  11. USERCTL------------Whether non-root users are allowed to control the device, no means it can only be modified by root users
  12. DNS1-------------------------The first dns server, you can fill in the gateway address
  13. DNS2-------------------------The second dns server, you can fill in 8.8.8.8

6. After filling in the configuration information in the previous step, saving and exiting, restart the network service and enter the command

service network restart

7. Enter the command ifconfig to view the network information just configured

8. Using the ping command, the ability to ping indicates that the network configuration is complete


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324683272&siteId=291194637