Virtual machine centos6.4 network connection settings -- bridge settings

  1. After the virtual machine is installed, two network cards, VMware Network Adapter VMnet1 and VMware Network Adapter Vmnet8, appear in the local network settings. Vmnet8 for networking.

     

     

    Virtual machine centos6.4 network connection settings -- bridge settings
  2.  

    Set the network card for connecting to the network, I use wireless Internet access, so I set the wireless network card, and tick the red box before Vmware Bridge Protocol.

    Virtual machine centos6.4 network connection settings -- bridge settings
  3.  

    1. Set the network connection sharing properties Select VMnet8 in the home network connection, and then tick the front. Sure.

    , 2, view the IP of the local network connection and set the IP of Vmarenet8.

      Example: If the local IP is 192.168.1.100, then the IP of Vmarenet8 is 192.168.1.1, the mask is the same, the gateway is set to 192.168.1.x, and x can be any number from 2 to 254, but the smaller the better.

    Note: Check the box in front of Vmware Bridge Protocol in the property settings.

     

    Virtual machine centos6.4 network connection settings -- bridge settings
  4.  

    The machine network setting is complete. Let's start to set the virtual machine network settings.

    Click on the virtual machine, click Edit === "Virtual Network Editor" in the menu item, and set the Vmnet0 bridge mode

     

    Virtual machine centos6.4 network connection settings -- bridge settings
    Virtual machine centos6.4 network connection settings -- bridge settings
  5.  

    After the bridge mode setting is completed, set Vmnet8, NAT mode, see the picture

    After the application, click NAT settings to see, it is the same as the gateway set in the local VMware Network Adapter VMnet8, and click OK.

     

    Virtual machine centos6.4 network connection settings -- bridge settings
  6.  

    Linux system settings on the virtual machine. Select the system you want to set up under the virtual machine menu

    Right-click --> set setting. Set the network card connection method

    Virtual machine centos6.4 network connection settings -- bridge settings
    Virtual machine centos6.4 network connection settings -- bridge settings
  7.  

    Enter the system to perform network settings in the system

    System Settings system --> Preferences preference--> Network Settings Network Connections

    Select System eth0, click Edit to edit

     

    Virtual machine centos6.4 network connection settings -- bridge settings
    Virtual machine centos6.4 network connection settings -- bridge settings
  8.  

    After the setting is completed, you need to restart the network card on the terminal teminal.

    Restart with service network restart

    Virtual machine centos6.4 network connection settings -- bridge settings
  9.  

    1. After restarting, view the network configuration Vim /etc/sysconfig/network-scripts/ifcfg-eth0 to view and edit it.

     

    [root@centos ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0   

      打开文件,修改以下内容并保存

          DEVICE=eth0          #对应第一张网卡

          TYPE=Ethernet

          ONBOOT=yes          #是否启动时运行

          NM_CONTROLLED=yes

          BOOTPROTO=dhcp         ip获得方式有none,dhcp分配ip

                                                   static静态的ip。看设置ip时,是自己添加

                                                    ip-static还是分配ip-dhcp

                                                自己添加ip时下面会显示ip地址,网关,子网掩码

          DEFROUTE=yes

           IPV4_FAILURE_FATAL=yes

           IPV6INIT=no

           NAME="System eth0"      #名称

           HWADDR=00:0C:29:60:2E:17     #必须对应etho是的MAC地址

    (/etc/udev/rules.d/70-persistent-net.rules)

          PEERDNS=yes   PEERROUTES=yes

           IPADDR=192.168.1.45    #指定本机IP地址

           NETMASK=255.255.255.0    #指定子网掩码

           GATEWAY=192.168.1.1     #指定网关

    2, 退出来,在重启一遍网卡 service network restart。

    3, 这时就可以连接网络了。

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326775321&siteId=291194637