Vbox enhanced network mode

Source: Internet
Author: User

 

In the previous blog, we mentioned the network type in vbox 4:

Nat

Bridged Adapter

Internal

Host-onlyadapter

 

For details, refer:

Oracle virtual box installation instructions

Http://blog.csdn.net/tianlesoftware/article/details/6826389

 

Today, I upgraded a vbox to 4.1.8. In this version, I enhanced the network and added UDP support. After the upgrade, I checked the vbox and added a generic driver, because we didn't pay attention to whether this mode exists, we cannot determine whether genericdriver is available in the new version. However, I checked the reference document and added the content. Here I will record this content.

 

 

The online reference manual of virtual box describes the network mode:

Http://www.virtualbox.org/manual/ch06.html

 

There are also reference documents under the installation directory, including CHM and PDF.

 

1. virtualbox network type

Each of theeight networking adapters can be separately configured to operate in one of thefollowing modes:

 

1.1 not attached

In this mode, virtualbox reports to the guest that a network card is present, but that thereis no connection -- as if no ethernet cable was plugged into the card. this wayit is possible to "pull" the virtual ethernet cable and disrupt THECONNECTION, which can be useful to inform a guest operating system that nonetwork connection is available and enforce a reconfiguration.

 

1.2 network addresstranslation (NAT)

If all you wantis to browse the Web, download files and view e-mail inside the guest, thenthis default mode shoshould be sufficient for you, and you can safely skip therest of this section. please note that there are certain limitations when usingwindows file sharing (see the section called "nat limitations" Fordetails ).

 

1.3 bridged networking

This is for moreadvanced networking needs such as network simulations and running servers in aguest. when enabled, virtualbox connects to one of your installed network cardsand exchanges network packets directly, circumventing your host operatingsystem's network stack.

 

1.4 internal networking

This can be usedto create a different kind of software-based network which is visible toselected virtual machines, but not to applications running on the host or tothe outside world.

 

1.5 host-only networking

This can be used to create a networkcontaining the host and a set of virtual machines, without the need for thehost's physical network interface. instead, a virtual network interface (similar to a loopback interface) is created on the host, providingconnectivity among virtual machines and the host.

 

1.6 generic networking

Rarely usedmodes share the same generic network interface, by allowing the user to selecta driver which can be encoded with virtualbox or be distributed in anextension pack.

At the moment there are potentially twoavailable sub-modes:

1.6.1 UDP Tunnel

This can be usedto interconnect virtual machines running on different hosts directly, easilyand transparently, over existing network infrastructure.

 

1.6.2 VDE (virtualdistributed Ethernet) Networking

This option canbe used to connect to a virtual distributed Ethernet switch on a Linux or afreebsd host. At the moment this needs compiling virtualbox from sources, asthe Oracle packages do not include it.

 

2. UDP and vdenetworking

2.1 UDP tunnel networking

This networkingmode allows to interconnect virtual machines running on different hosts.

Technically thisis done by encapsulating Ethernet frames sent or received by the guest networkcard into UDP/IP Route rams, and sending them over any network available to thehost.

 

UDP tunnel mode has three parameters:

-- UDP tunnel mode has three parameters:

(1) Source UDP port

The port onwhich the host listens. datagrams arriving on this port from any source addresswill be forwarded to the processing part of the guest network card.

(2) Destination Address

IP address ofthe target host of the transmitted data.

(3) Destination UDP port

Port Number towhich the transmitted data is sent.

 

Wheninterconnecting two virtual machines on two different hosts, their IP addressesmust be swapped. on single host, source and destination UDP ports must beswapped.

 

In the followingexample HOST 1 uses the IP address 10.0.0.1 and host 2 uses IP address10.0.0.2. configuration via command-line:

Vboxmanage modifyvm "VM 01 on host1" -- Nic <x> generic

Vboxmanage modifyvm "VM 01 on Host 1" -- nicgenericdrv <x> udptunnel

Vboxmanage modifyvm "VM 01 on Host 1" -- nicproperty <x> DEST = 10.0.0.2

Vboxmanage modifyvm "VM 01 on Host 1" -- nicproperty <x> sport = 10001

Vboxmanage modifyvm "VM 01 on Host 1" -- nicproperty <x> dport = 10002

 

And

Vboxmanage modifyvm "VM 02 on host 2" -- Nic <Y> generic

Vboxmanage modifyvm "VM 02 on host 2" -- nicgenericdrv <Y> udptunnel

Vboxmanage modifyvm "VM 02 on host 2" -- nicproperty <Y> DEST = 10.0.0.1

Vboxmanage modifyvm "VM 02 on host 2" -- nicproperty <Y> sport = 10002

Vboxmanage modifyvm "VM 02 on host 2" -- nicproperty <Y> dport = 10001

 

Of course, youcan always interconnect two virtual machines on the same host, by setting thedestination address parameter to 127.0.0.1 on both. it will act similarly to "internal network" in this case, however the host can see the networktraffic which it cocould not in the normal internal network case.

 

Note

On Unix-basedhosts (e.g. linux, Solaris, Mac OS X) it is not possible to bind to ports below1024 from applications that are not run by root. as a result, if you tryto configure such a source UDP port, the VM will refuse to start.

 

2.2 VDE networking

Virtualdistributed Ethernet (VDE [30]) is a flexible, virtual networkinfrastructure system, spanning implements SS multiple hosts in a secure way. itallows For L2/L3 switching, including spanning-Tree Protocol, VLANs, and wanemulation. it is an optional part of virtualbox which is only supported in thesource code.

 

The basicbuilding blocks of the infrastructure are VDE switches, VDE plugs and VDE wireswhich inter-connect the switches.

 

The virtualbox VDE driver has oneparameter:

-- VDE driver has only one parameter:

Vde Network

The name of thevde network switch socket to which the VM will be connected.

 

The following basic example shows how to connect a virtual machine to a VDE switch:

1. Create a VDE switch:

Vde_switch-S/tmp/switch1

 

2. configuration via command-line:

Vboxmanage modifyvm "VM name" -- Nic <x> generic

Vboxmanage modifyvm "VM name" -- nicgenericdrv <x> VDE

 

To connect to automatically allocatedswitch port, use:

Vboxmanagemodifyvm "VM name" -- nicproperty <x> network =/tmp/switch1

 

To connect to specific switch port <n>, use:

Vboxmanagemodifyvm "VM name" -- nicproperty <x> network =/tmp/switch1 [<n>]

 

The latter option can be useful for VLANs.

 

Optionally map between VDE switch port andvlan: (from Switch cli)

Vde $ VLAN/create <VLAN>

Vde $ port/setvlan <port> <VLAN>

 

Vde is availableon Linux and FreeBSD hosts only. it is only available if the VDE software andthe VDE plugin library from the virtual square project are installed on thehost system. for more information on setting up VDE networks, please see thedocumentation accompanying the software.

 

 

 

 

Bytes -------------------------------------------------------------------------------------------------------

All rights reserved. reprinted articles are allowed, but source addresses must be indicated by links. Otherwise, the documents will be held legally responsible!

Email: tianlesoftware@gmail.com

Skype: tianlesoftware

Blog: http://www.tianlesoftware.com

WEAVER: http://weibo.com/tianlesoftware

Twitter: http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

 

------- Add a group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, reject the application ----

Dba1 group: 62697716 (full); dba2 group: 62697977 (full) dba3 group: 62697850 (full)

Super DBA group: 63306533 (full); dba4 group: 83829929 dba5 group: 142216823

Group dba6: 158654907 dba7: 172855474

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.