How are the --network options available in podman?

Viewed 1395

I am running a virtual environment on CentOS with podman. When I used the --net option of the podman run command, I get an error.

[user@server ~]$ podman run --net slirp4netns:port_handler=slirp4netns -p 1080:80 -d --name web nginx
Error: cannot join CNI networks if running rootless: invalid argument

Is this option unavailable?
Or is there a problem with the way the options are specified?
Please tell me solution.
I used this site as a reference for the command.

This is the configuration of the server.

[user@server ~]$ cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
[user@server ~]$ podman -v
podman version 2.0.6
2 Answers

I find this link quite helpful to see rootless communication :

I am not sure if you have seen this link before or even if it is helpful to you at this instance. But, in view of helping others out, I think the blog post quotes the following helpful statements:

Note: All podman network commands are for rootfull containers only.

Technically, the container itself does not have an IP address, because without root privileges, network device association cannot be achieved

When using Podman as a rootless user, the network is setup automatically. The container itself does not have an IP Address, because without root privileges, network association is not allowed. You will also see some other limitations.

Related