Configuration of connecting Ubuntu dual NICs to the Intranet and Internet respectively

Source: Internet
Author: User

To install Ubuntu server 10.04 with virtual box in Ubuntu, you need to connect to the Internet to install software, but you also need to access it on the local machine. If you want to assign an intranet IP address, you need to configure a bridge, I used it once before, which is too troublesome.

Therefore, we consider using other solutions, such as two NICs for the virtual machine, one Nat mode and one host-only mode.

Since Linux can only have one default gateway, the NAT mode is the DHCP dynamically assigned IP address managed by virtualbox, and the host-only mode can set its own IP address. The solution is obvious:

First, modify the Ubuntu network configuration file.

Sudo VI/etc/Network/interfaces

Modify the file content as follows:

# The loopback network interface
Auto Lo
Iface lo Inet loopback

# The primary network interface
Auto eth0
Iface eth0 Inet DHCP

# The second eth1
Auto eth1
Iface eth1 Inet static
Address 192.168.56.68
Netmask 255.255.255.0

Eth0 is a NAT Nic, and eth1 is a host-only NIC.

In this way, you can restart the virtual machine.

The network segment 192.168.56. * is used for communication between the host and the virtual machine.

Virtual machines and Internet communication can directly access the address, as long as the host can access, virtual machines can access

Over!

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.