VirtualBox

source: vbox/trunk/doc/manual/en_US/dita/topics/network_hostonly.dita@ 105324

最後變更 在這個檔案從105324是 105293,由 vboxsync 提交於 8 月 前

FE/Qt: bugref:10705. Some more merges from docs team repo. white space changes.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 6.1 KB
 
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_hostonly">
4 <title>Host-Only Networking</title>
5
6 <body>
7 <p>
8 Host-only networking can be thought of as a hybrid between the
9 bridged and internal networking modes. As with bridged networking,
10 the virtual machines can talk to each other and the host as if
11 they were connected through a physical Ethernet switch. As with
12 internal networking, a physical networking interface need not be
13 present, and the virtual machines cannot talk to the world outside
14 the host since they are not connected to a physical networking
15 interface.
16 </p>
17 <p>
18 When host-only networking is used, <ph conkeyref="vbox-conkeyref-phrases/product-name"/> creates a new
19 software interface on the host which then appears next to your
20 existing network interfaces. In other words, whereas with bridged
21 networking an existing physical interface is used to attach
22 virtual machines to, with host-only networking a new
23 <i>loopback</i> interface is created on the host.
24 And whereas with internal networking, the traffic between the
25 virtual machines cannot be seen, the traffic on the loopback
26 interface on the host can be intercepted.
27 </p>
28 <note>
29 <p>
30 Hosts running recent macOS versions do not support host-only
31 adapters. These adapters are replaced by host-only networks,
32 which define a network mask and an IP address range, where the
33 host network interface receives the lowest address in the range.
34 </p>
35 <p>
36 The host network interface gets added and removed dynamically by
37 the operating system, whenever a host-only network is used by
38 virtual machines.
39 </p>
40 <p>
41 On macOS hosts, choose the <b outputclass="bold">Host-Only
42 Network</b> option when configuring a network adapter.
43 The <b outputclass="bold">Host-Only Adapter</b> option is
44 provided for legacy support.
45 </p>
46 </note>
47 <p>
48 Host-only networking is particularly useful for preconfigured
49 virtual appliances, where multiple virtual machines are shipped
50 together and designed to cooperate. For example, one virtual
51 machine may contain a web server and a second one a database, and
52 since they are intended to talk to each other, the appliance can
53 instruct <ph conkeyref="vbox-conkeyref-phrases/product-name"/> to set up a host-only network for the two.
54 A second, bridged, network would then connect the web server to
55 the outside world to serve data to, but the outside world cannot
56 connect to the database.
57 </p>
58 <p>
59 To enable a host-only network interface for a virtual machine, do
60 either of the following:
61 </p>
62 <ul>
63 <li>
64 <p>
65 Go to the <b outputclass="bold">Network</b> page in the
66 virtual machine's <b outputclass="bold">Settings</b>
67 dialog and select an <b outputclass="bold">Adapter</b>
68 tab. Ensure that the <b outputclass="bold">Enable Network
69 Adapter</b> check box is selected and choose
70 <b outputclass="bold">Host-Only Adapter</b> for the
71 <b outputclass="bold">Attached To</b> field.
72 </p>
73 </li>
74 <li>
75 <p> On the command line, use <userinput>VBoxManage modifyvm vmname --nic
76 <varname>x</varname> hostonly</userinput>. See <xref href="vboxmanage-modifyvm.dita"
77 />. </p>
78 </li>
79 </ul>
80 <p>
81 For host-only networking, as with internal networking, you may
82 find the DHCP server useful that is built into <ph conkeyref="vbox-conkeyref-phrases/product-name"/>.
83 This is enabled by default and manages the IP addresses in the
84 host-only network. Without the DHCP server you would need to
85 configure all IP addresses statically.
86 </p>
87 <ul>
88 <li>
89 <p>
90 In <ph conkeyref="vbox-conkeyref-phrases/vbox-mgr"/> you can configure the DHCP server by choosing
91 <b outputclass="bold">File</b>,
92 <b outputclass="bold">Tools</b>,
93 <b outputclass="bold">Network Manager</b>. The Network
94 Manager window lists all host-only networks which are
95 presently in use. Select the network name and then use the
96 <b outputclass="bold">DHCP Server</b> tab to configure
97 DHCP server settings. See <xref href="network-manager.dita#network-manager"/>.
98 </p>
99 </li>
100 <li>
101 <p> Alternatively, you can use the <userinput>VBoxManage dhcpserver</userinput> command. See
102 <xref href="vboxmanage-dhcpserver.dita"/>. </p>
103 </li>
104 </ul>
105 <note>
106 <p>
107 On Linux and macOS hosts the number of host-only interfaces is
108 limited to 128. There is no such limit for Oracle Solaris and
109 Windows hosts.
110 </p>
111 </note>
112 <p> On Linux, macOS and Solaris <ph conkeyref="vbox-conkeyref-phrases/product-name"/> will only
113 allow IP addresses in 192.168.56.0/21 range to be assigned to host-only adapters. For IPv6
114 only link-local addresses are allowed. If other ranges are required, they can be enabled by
115 creating <filepath>/etc/vbox/networks.conf</filepath> and specifying allowed ranges there. For
116 example, to allow 10.0.0.0/8 and 192.168.0.0/16 IPv4 ranges as well as 2001::/64 range put the
117 following lines into <filepath>/etc/vbox/networks.conf</filepath>: </p>
118 <pre xml:space="preserve"> * 10.0.0.0/8 192.168.0.0/16
119 * 2001::/64
120 </pre>
121 <p>
122 Lines starting with the hash <userinput>#</userinput> are ignored. The
123 following example allows any addresses, effectively disabling
124 range control:
125 </p>
126 <pre xml:space="preserve"> * 0.0.0.0/0 ::/0
127 </pre>
128 <p>
129 If the file exists, but no ranges are specified in it, no
130 addresses will be assigned to host-only adapters. The following
131 example effectively disables all ranges:
132 </p>
133 <pre xml:space="preserve"> # No addresses are allowed for host-only adapters
134 </pre>
135 </body>
136
137</topic>
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette