Centos virtual machine networking problems

Networking in bridge mode

  • Manual IP configuration using the setup command
  1. View Host ip
    win + R-> cmd> ipconfig

  2. Use the setup command to set the virtual network card ip
    the IP settings for the virtual network adapter in the phenomenon of the same network segment, but not for the same IP, otherwise there will be a virtual machine and the host can not access the Internet with the host

  3. After resetting the card information to restart the network services service network restart

  4. Then the card will start the set ifup + [name of the NIC / eth0] // can directly edit the / etc / sysconfig / network-scripts / ifcfg-eth0 card system to boot up automatically on startup: The ONBOOT = no change ONBOOT = yes
    Here Insert Picture Description

    1. View IP with ifconfig, and see if you can access
  • NIC directly modify file

    1. NIC configuration file / etc / sysconfig / network-scripts / ifcfg-eth0
    = Insert Picture description here
    2. Open the file in the file can be directly modifiedHere Insert Picture Description

  • Modify the network card configuration file (that is, the above command open), the Internet services can automatically obtain an IP go in every time you start
    the BOOTPROTO = none = dhcp instead be BOOTPROTO
    NM_CONTROL = yes instead NM_CONTROL = no
    other command " # "to comment out
    The BOOTPROTO = none instead

Guess you like

Origin blog.csdn.net/qq_44365878/article/details/94656114