Centos Virtual Machine bridging configuration, centos Virtual Machine Bridge

Source: Internet
Author: User
Tags nameserver

Centos Virtual Machine bridging configuration, centos Virtual Machine Bridge

Step 2

After the Virtual Machine fedora is installed, open the menu bar of the vmvirtual machine, click Edit ------ Virtual Network Editor, select the "host Virtual Network ing" tab, then manually select VMnet0 as your local physical NIC (select the NIC you are using, for example, your computer has a wireless Nic and a wired Nic; you are using a wireless network now, connect to the wireless network card. If you are using a wired network card, connect to the wired network card.) do not select automatic settings. Click OK.

Step 2

Enter the operating system of the VM, open the Super Terminal, enter ifconfig eth0, and check the network settings of eth0.
Check whether the VM and the host are in the same network segment. If the host machine IP address is 192.168.0.2, the virtual machine IP address should be from 192.168.0.1 to 192.168.0.254. The most important step is to set the Virtual Machine gateway as the physical IP address of the host. This is very important. Many people may not be connected to the virtual machine, and the Host IP address is used as the gateway of the virtual machine.

Step 2

Set the host system and linux under the virtual machine.
1) disable the firewall of the host machine; Omitted

2) disable the firewall of the virtual machine;
# Chkconfig iptables off // takes effect after restart and is permanently disabled
#/Etc/init. d/iptables status // you can view the Firewall status.

3) Disable selinux of the virtual machine;
# Vi/etc/selinux/config // change SELINUX = enforcing to SELINUX = disabled // save and exit. the restart takes effect and is permanently disabled.

# Getenforce // you can view the selinux status.

Step 2

Test whether the settings take effect.
1) when the host is pinged to the ip address of the eth0 Nic of the VM, the firewall or selinux of the VM is not disabled.

2) If the VM is pinged to the Host ip address, the firewall on the host is not closed.

3) ping each other to complete the settings. // Enjoy !!

If there is still a problem, check whether the firewall is set up, and check whether some operations that need to be restarted take effect have been restarted. Generally, this is not a problem. Start the VM again. Internet access should be available. For users who use dial-up Internet access, they can only be online at the same time under the host and virtual machine.

Note: The most important step is to set the gateway of the VM as the physical IP address of the host ", 1. You can also set the gateway of the virtual machine to the gateway configured in the IP address of the host machine; 2. the DNS settings of the virtual machine must be configured with the gateway in the IP address of the host machine.
With regard to 1, the Internet can speed up. With regard to 2, if you do not set it, you will not be able to access the jump page of the Internet, because the ip address similar to www.baidu.com you ping each time, they are all different. Therefore, DNS must be configured in the virtual machine.

The following describes how to configure DNS:

1. Configure DNS
Vi/etc/resolv. conf
Join:

nameserver 192.168.0.1 nameserver 8.8.8.8nameserver 8.8.4.4

2. Configure the Gateway:

Vi/etc/sysconfig/network
Join:
GATEWAY = 192.168.0.1
Complete:

NETWORKING=yesHOSTNAME=localhost.localdomainGATEWAY=192.168.0.1
3. Configure the IP Address:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
The content is as follows:

DEVICE="eth0"HWADDR="00:0C:29:6C:BB:E6"NM_CONTROLLED="yes"ONBOOT="no"NETMASK=255.255.255.0IPADDR=192.168.0.8GATEWAY=192.168.0.1BOOTPROTO=staticONBOOT=yesPEERDNS=yes
4. Restart the service:

/Etc/init. d/network restart or use the command: service network restart or: ifdown eth0 and ifup eth0





Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.