I am playing with unshare
to better understand containers. As a normal user, is it possible to make a namespace where a program could listen, say, port 123
and on the "main" namespace a port 1234
would be redirected to it?
I guess it should be, as Podman is rootless container engine and can do it. Looking man veth
did not help.
Podman works by using slirp4netns to manage a tap device inside the unprivileged container. From the README for slirp4netns:
In order to achieve your goal, you would need to do something similar.