1 | <?xml version='1.0' encoding='UTF-8'?>
|
---|
2 | <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
|
---|
3 | <topic xml:lang="en-us" id="network_udp_tunnel">
|
---|
4 | <title>UDP Tunnel Networking</title>
|
---|
5 |
|
---|
6 | <body>
|
---|
7 | <p>This networking mode enables you to interconnect virtual machines running on different hosts. </p>
|
---|
8 | <p>Technically this is done by encapsulating Ethernet frames sent or received by the guest network card into UDP/IP
|
---|
9 | datagrams, and sending them over any network available to the host. </p>
|
---|
10 | <p>UDP Tunnel mode has the following parameters: </p>
|
---|
11 | <ul>
|
---|
12 | <li>
|
---|
13 | <p><b outputclass="bold">Source UDP port:</b> The port on
|
---|
14 | which the host listens. Datagrams arriving on this port from
|
---|
15 | any source address will be forwarded to the receiving part of
|
---|
16 | the guest network card.
|
---|
17 | </p>
|
---|
18 | </li>
|
---|
19 | <li>
|
---|
20 | <p><b outputclass="bold">Destination address:</b> IP
|
---|
21 | address of the target host of the transmitted data.
|
---|
22 | </p>
|
---|
23 | </li>
|
---|
24 | <li>
|
---|
25 | <p><b outputclass="bold">Destination UDP port:</b> Port
|
---|
26 | number to which the transmitted data is sent.
|
---|
27 | </p>
|
---|
28 | </li>
|
---|
29 | </ul>
|
---|
30 | <p>When interconnecting two virtual machines on two different hosts, their IP addresses must be swapped. On a single
|
---|
31 | host, source and destination UDP ports must be swapped. </p>
|
---|
32 | <p>In the following example, host 1 uses the IP address 10.0.0.1 and host 2 uses IP address 10.0.0.2. To configure
|
---|
33 | using the command-line: </p>
|
---|
34 | <pre xml:space="preserve"> VBoxManage modifyvm "VM 01 on host 1" --nic<x> generic
|
---|
35 | VBoxManage modifyvm "VM 01 on host 1" --nic-generic-drv<x> UDPTunnel
|
---|
36 | VBoxManage modifyvm "VM 01 on host 1" --nic-property<x> dest=10.0.0.2
|
---|
37 | VBoxManage modifyvm "VM 01 on host 1" --nic-property<x> sport=10001
|
---|
38 | VBoxManage modifyvm "VM 01 on host 1" --nic-property<x> dport=10002</pre>
|
---|
39 | <pre xml:space="preserve"> VBoxManage modifyvm "VM 02 on host 2" --nic<y> generic
|
---|
40 | VBoxManage modifyvm "VM 02 on host 2" --nic-generic-drv<y> UDPTunnel
|
---|
41 | VBoxManage modifyvm "VM 02 on host 2" --nic-property<y> dest=10.0.0.1
|
---|
42 | VBoxManage modifyvm "VM 02 on host 2" --nic-property<y> sport=10002
|
---|
43 | VBoxManage modifyvm "VM 02 on host 2" --nic-property<y> dport=10001</pre>
|
---|
44 | <p>Of course, you can always interconnect two virtual machines on the same host, by setting the destination address
|
---|
45 | parameter to 127.0.0.1 on both. It will act similarly to an internal network in this case. However, the host can
|
---|
46 | see the network traffic which it could not in the normal internal network case. </p>
|
---|
47 | <note>
|
---|
48 | <p>On UNIX-based hosts, such as Linux, Oracle Solaris, and Mac OS X, it is not possible to bind to ports below
|
---|
49 | 1024 from applications that are not run by <codeph>root</codeph>. As a result, if you try to configure such a
|
---|
50 | source UDP port, the VM will refuse to start. </p>
|
---|
51 | </note>
|
---|
52 | </body>
|
---|
53 |
|
---|
54 | </topic>
|
---|