"Ubuntu Everyday Skills" VirtualBox multi-NIC routing configuration to ensure virtual Machine connection Sisu Network

Source: Internet
Author: User

" background ": Configure Ubuntu Virtual machine Dual network card, one is Host-only network, one is Bridge network. When the virtual machine is connected to two networks at the same time, the virtual machine can ping the internal network, not ping the external network, such as www.baidu.com.

1. Virtual Machine NIC Configuration

    

2. Virtual Machine Internal network configuration

Hostonly Network configuration:

Bridging Network configuration:

 

3. Check the virtual machine network

Ping does not pass the extranet, view the routing table.

 

Failure reason: found that the default route is Hostonly network, the network segment is 56 segments, cannot communicate with the external network, the default route is modified to 1 segments (192.168.1.X).

4. Modifying the default route
dev@dev-virtualbox:~$sudoRoute add default GW192.168.1.1Dev@dev-virtualbox:~$ routekernel IP routing tabledestination Gateway genmask Flags Metric Ref use Ifacedefault 192.168.1.1     0.0.0.0Ug0      0        0Eth1default192.168.56.1    0.0.0.0Ug0      0        0eth0192.168.1.0*255.255.255.0U1      0        0eth1192.168.56.0*255.255.255.0U1      0        0Eth0

The modification found that there were two default routes, and then DNS appeared, and the domain name resolution could not be performed.

Solution:

Delete the default route for a 56 network segment

dev@dev-virtualbox:~$sudoRoute del default GW192.168.56.1Dev@dev-virtualbox:~$ routekernel IP routing tabledestination Gateway genmask Flags Metric Ref use Ifacedefault 192.168.1.1     0.0.0.0Ug0      0        0eth1192.168.1.0*255.255.255.0U1      0        0eth1192.168.56.0*255.255.255.0U1      0        0Eth0

 

There is also a relatively simple scenario, when creating a virtual machine NIC, set the virtual machine network card sequence is: Network card 1 bridge network, network card 2HostOnly.

 

"Ubuntu Everyday Skills" VirtualBox multi-NIC routing configuration to ensure virtual Machine connection Sisu Network

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.