Skip to content

Commit 1f90cc1

Browse files
committed
docs: update pasta options description
First, remove wrong sentence that says ports are forwarded dynamically by default. That is wrong and contradicts what is written below. Second, document that we also set --dns-forward and --map-guest-addr by default. And lastly document the containers.conf field so users know they are not forced to set the options on each command. Signed-off-by: Paul Holzinger <[email protected]>
1 parent 4f75d0b commit 1f90cc1

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

docs/source/markdown/options/network.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ Valid _mode_ values are:
5151
stack. \
5252
This is the default for rootless containers and only supported in rootless mode. \
5353
By default, IPv4 and IPv6 addresses and routes, as well as the pod interface
54-
name, are copied from the host. If port forwarding isn't configured, ports
55-
are forwarded dynamically as services are bound on either side (init
56-
namespace or container namespace). Port forwarding preserves the original
54+
name, are copied from the host. Port forwarding preserves the original
5755
source IP address. Options described in pasta(1) can be specified as
5856
comma-separated arguments. \
5957
In terms of pasta(1) options, **--config-net** is given by default, in
@@ -62,11 +60,20 @@ Valid _mode_ values are:
6260
container to host using the gateway address. The latter can be overridden
6361
by passing **--map-gw** in the pasta-specific options (despite not being an
6462
actual pasta(1) option). \
63+
For better integration with DNS handling, **--dns-forward 169.254.1.1** is passed,
64+
and this address is added to resolv.conf(5) as first resolver. It is possible to pass
65+
**--dns-forward** explicitly in case a different IP address should be used.
66+
To make the `host.containers.internal` /etc/hosts entry work and allow connections
67+
to the host, **--map-guest-addr 169.254.1.2** is passed. Again, it can be set
68+
explicitly to choose a different IP address. \
6569
Also, **-t none** and **-u none** are passed if, respectively, no TCP or
66-
UDP port forwarding from host to container is configured, to disable
67-
automatic port forwarding based on bound ports. Similarly, **-T none** and
68-
**-U none** are given to disable the same functionality from container to
70+
UDP port forwarding from host to container is configured (via Podman's
71+
**--publish** or by passing the pasta **-t**/**-u** options directly),
72+
to disable automatic port forwarding based on bound ports. Similarly, **-T none**
73+
and **-U none** are given to disable the same functionality from container to
6974
host. \
75+
All options can also be set in **[containers.conf(5)](https://github.com/containers/common/blob/main/docs/containers.conf.5.md)**;
76+
see the `pasta_options` key under the network section in that file. \
7077
Some examples:
7178
- **pasta:--map-gw**: Allow the container to directly reach the host using the
7279
gateway address.

0 commit comments

Comments
 (0)