Skip to content

rootless podman using pasta doesn't allow accessing the host-service ports #22771

@slartibart70

Description

@slartibart70

Issue Description

Client: Podman Engine
Version: 5.0.3
API Version: 5.0.3
Go Version: go1.22.2
Built: Fri May 10 02:00:00 2024
OS/Arch: linux/amd64

Using --network='host' or --network=slirp4netns i can access the hosts services, here sftp on port22 successfully.

With the new default 'pasta' network, this is no longer possible according to the docs (man podman-run, look for network/pasta)

But, the docs also state that the 'non-valid' pasta option --map-gw does indeed allow host-service communication coming from the container (as i understand). Sadly, this does not work:
podman run --rm -it --network=pasta:--map-gw 09db474e1757 bash
or defining this in ".config/containers/containers.conf"

[network]
default_rootless_network_cmd="pasta"
pasta_options = ["--map-gw"]

does not give me host-communications back.

Moreover, if you define the above in containers.conf AND run podman with podman run --rm -it --network=pasta:--map-gw ... podman crashes with the error:

panic: runtime error: slice bounds out of range [3:2]

Yes, i can use the options exclusively (commandline OR containers.conf) and a can use 'host' or 'slip4netns' but shouldn't this also work with pasta???
Any help is appreciated

Steps to reproduce the issue

see above

Describe the results you received

see above

Describe the results you expected

pasta network should allow a rootless-container to access host-services if configured properly

podman info output

If you are unable to run podman info for any reason, please provide the podman version, operating system and its version and the architecture you are running.

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.networkNetworking related issue or featurepastapasta(1) bugs or features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions