Skip to content

Commit a3ac225

Browse files
authored
Merge pull request #2800 from AkihiroSuda/dev
website: network: move socket_vmnet to the bottom of the page; fix wording
2 parents 0422e67 + 1079776 commit a3ac225

File tree

1 file changed

+75
-75
lines changed
  • website/content/en/docs/config/network

1 file changed

+75
-75
lines changed

website/content/en/docs/config/network/_index.md

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ The loopback addresses of the host is `192.168.5.2` and is accessible from the g
3333

3434
### DNS (192.168.5.3)
3535

36-
The DNS.
37-
3836
If `hostResolver.enabled` in `lima.yaml` is true, then the hostagent is going to run a DNS server over tcp and udp - each on a separate randomly selected free port. This server does a local lookup using the native host resolver, so it will deal correctly with VPN configurations and split-DNS setups, as well as mDNS, local `/etc/hosts` etc. For this the hostagent has to be compiled with `CGO_ENABLED=1` as default Go resolver is [broken](https://github.com/golang/go/issues/12524).
3937

4038
These tcp and udp ports are then forwarded via iptables rules to `192.168.5.3:53`, overriding the DNS provided by QEMU via slirp.
@@ -57,18 +55,86 @@ During initial cloud-init bootstrap, `iptables` may not yet be installed. In tha
5755

5856
If `hostResolver.enabled` is false, then DNS servers can be configured manually in `lima.yaml` via the `dns` setting. If that list is empty, then Lima will either use the slirp DNS (on Linux), or the nameservers from the first host interface in service order that has an assigned IPv4 address (on macOS).
5957

58+
## Lima user-v2 network
59+
60+
| ⚡ Requirement | Lima >= 0.16.0 |
61+
|-------------------|----------------|
62+
63+
user-v2 network provides a user-mode networking similar to the [default user-mode network](#user-mode-network--1921685024-) and also provides support for `vm -> vm` communication.
64+
65+
To enable this network mode, define a network with `mode: user-v2` in networks.yaml
66+
67+
By default, the below network configuration is already applied (Since v0.18).
68+
69+
```yaml
70+
...
71+
networks:
72+
user-v2:
73+
mode: user-v2
74+
gateway: 192.168.104.1
75+
netmask: 255.255.255.0
76+
...
77+
```
78+
79+
Instances can then reference these networks from their `lima.yaml` file:
80+
81+
{{< tabpane text=true >}}
82+
{{% tab header="CLI" %}}
83+
```bash
84+
limactl start --network=lima:user-v2
85+
```
86+
{{% /tab %}}
87+
{{% tab header="YAML" %}}
88+
```yaml
89+
networks:
90+
- lima: user-v2
91+
```
92+
{{% /tab %}}
93+
{{< /tabpane >}}
94+
95+
An instance's IP address is resolvable from another instance as `lima-<NAME>.internal.` (e.g., `lima-default.internal.`).
96+
97+
_Note_
98+
99+
- Enabling this network will disable the [default user-mode network](#user-mode-network--1921685024-)
100+
60101
## VMNet networks
61102

62103
VMNet assigns a "real" IP address that is reachable from the host.
63104

64105
The configuration steps are different for each network type:
65-
- [socket_vmnet](#socket_vmnet)
66106
- [vzNAT](#vzNAT)
107+
- [socket_vmnet](#socket_vmnet)
108+
109+
### vzNAT
110+
111+
| ⚡ Requirement | Lima >= 0.14, macOS >= 13.0 |
112+
|-------------------|-----------------------------|
113+
114+
For [VZ](../vmtype/#vz) instances, the "vzNAT" network can be configured as follows:
115+
{{< tabpane text=true >}}
116+
{{% tab header="CLI" %}}
117+
```bash
118+
limactl start --vm-type=vz --network=vzNAT
119+
```
120+
{{% /tab %}}
121+
{{% tab header="YAML" %}}
122+
```yaml
123+
networks:
124+
- vzNAT: true
125+
```
126+
{{% /tab %}}
127+
{{< /tabpane >}}
128+
129+
The range of the IP address is not specifiable.
130+
131+
The "vzNAT" network does not need the `socket_vmnet` binary and the `sudoers` file.
67132

68133
### socket_vmnet
69134
#### Managed (192.168.105.0/24)
70135

71-
[`socket_vmnet`](https://github.com/lima-vm/socket_vmnet) is required for adding another guest IP that is accessible from the host and other guests.
136+
[`socket_vmnet`](https://github.com/lima-vm/socket_vmnet) can be used for adding another guest IP that is accessible from the host and other guests,
137+
without depending on vz.
72138
It must be installed according to the instruction provided on https://github.com/lima-vm/socket_vmnet.
73139

74140
Note that installation using Homebrew is not secure and not recommended by the Lima project.
@@ -197,78 +263,12 @@ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/boot
197263
```
198264

199265
#### Unmanaged
200-
```yaml
201-
networks:
202-
# Lima can also connect to "unmanaged" networks addressed by "socket". This
203-
# means that the daemons will not be controlled by Lima, but must be started
204-
# before the instance. The interface type (host, shared, or bridged) is
205-
# configured in socket_vmnet and not in lima.
206-
# - socket: "/var/run/socket_vmnet"
207-
```
208-
209-
### vzNAT
210-
211-
| ⚡ Requirement | Lima >= 0.14, macOS >= 13.0 |
212-
|-------------------|-----------------------------|
213-
214-
For [VZ](../vmtype/#vz) instances, the "vzNAT" network can be configured as follows:
215-
{{< tabpane text=true >}}
216-
{{% tab header="CLI" %}}
217-
```bash
218-
limactl start --vm-type=vz --network=vzNAT
219-
```
220-
{{% /tab %}}
221-
{{% tab header="YAML" %}}
222-
```yaml
223-
networks:
224-
- vzNAT: true
225-
```
226-
{{% /tab %}}
227-
{{< /tabpane >}}
228-
229-
The range of the IP address is not specifiable.
230-
231-
The "vzNAT" network does not need the `socket_vmnet` binary and the `sudoers` file.
232-
233-
## Lima user-v2 network
234-
235-
| ⚡ Requirement | Lima >= 0.16.0 |
236-
|-------------------|----------------|
266+
Lima can also connect to "unmanaged" networks addressed by "socket". This
267+
means that the daemons will not be controlled by Lima, but must be started
268+
before the instance. The interface type (host, shared, or bridged) is
269+
configured in `socket_vmnet` and not in lima.
237270

238-
user-v2 network provides a user-mode networking similar to the [default user-mode network](#user-mode-network--1921685024-) and also provides support for `vm -> vm` communication.
239-
240-
To enable this network mode, define a network with `mode: user-v2` in networks.yaml
241-
242-
By default, the below network configuration is already applied (Since v0.18).
243-
244-
```yaml
245-
...
246-
networks:
247-
user-v2:
248-
mode: user-v2
249-
gateway: 192.168.104.1
250-
netmask: 255.255.255.0
251-
...
252-
```
253-
254-
Instances can then reference these networks from their `lima.yaml` file:
255-
256-
{{< tabpane text=true >}}
257-
{{% tab header="CLI" %}}
258-
```bash
259-
limactl start --network=lima:user-v2
260-
```
261-
{{% /tab %}}
262-
{{% tab header="YAML" %}}
263271
```yaml
264272
networks:
265-
- lima: user-v2
273+
- socket: "/var/run/socket_vmnet"
266274
```
267-
{{% /tab %}}
268-
{{< /tabpane >}}
269-
270-
An instance's IP address is resolvable from another instance as `lima-<NAME>.internal.` (e.g., `lima-default.internal.`).
271-
272-
_Note_
273-
274-
- Enabling this network will disable the [default user-mode network](#user-mode-network--1921685024-)

0 commit comments

Comments
 (0)