Skip to content

Commit 426c80b

Browse files
committed
docs(portfwd): document disabling forwarding
Signed-off-by: Casey Quinn <casey.quinn@agyn.io>
1 parent e1dc411 commit 426c80b

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

templates/default.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,13 @@ networks:
489489
# # default: guestPortRange: [1, 65535]
490490
# # default: hostPortRange: [1, 65535]
491491
#
492-
# - guestIP: 0.0.0.0 # otherwise defaults to 127.0.0.1
493-
# proto: any # tcp and udp
494-
# ignore: true # don't forward these ports (guestPortRange, in this case 1-65535)
492+
# To disable all dynamic TCP/UDP forwarding (while keeping SSH available via `limactl shell`),
493+
# use a single ignore rule.
494+
# portForwards:
495+
# - guestIP: 0.0.0.0
496+
# guestIPMustBeZero: false # ensures 0.0.0.0 matches any guest interface
497+
# proto: any
498+
# ignore: true
495499
#
496500
# - guestPort: 7443
497501
# guestIP: "0.0.0.0" # Will match *any* interface

website/content/en/docs/config/port.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,18 @@ The benchmark result, especially the throughput of vzNAT, highly depends on the
129129
- Hardware: MacBook Pro 2024 (M4 Max, 128 GiB)
130130

131131
</p>
132-
</details>
132+
</details>
133+
134+
## Disable all port forwarding
135+
136+
To disable all dynamic TCP and UDP port forwarding from host localhost to the guest, add a single ignore rule to your instance configuration. This prevents any localhost ports from being forwarded (including IPv4 and IPv6), while SSH access via `limactl shell` continues to work.
137+
138+
```yaml
139+
portForwards:
140+
- guestIP: 0.0.0.0
141+
guestIPMustBeZero: false
142+
proto: any
143+
ignore: true
144+
```
145+
146+
Once applied, Lima will skip creating dynamic listeners for guest services and only the SSH control channel remains active. On Lima versions prior to 2.0, omit the `guestIPMustBeZero` field (the rule still works without it).

0 commit comments

Comments
 (0)