Possible to customize outgoing IP in rootless container
Hi assuming a host has 2 ips: 192.168.1.1 and 192.168.1.2 (as an ip alias). By default outgoing traffic is on 192.168.1.1 - is it possible to tell a rootless container (actually slirp4netns), that 192.168.1.2 should be used as the src ip? I would assume that this would need to be done be slirp4netns, but I wasn't able to find such an option. thanks and best mh
On 4/10/20 12:12, mh+podman@scrit.ch wrote:
Hi
assuming a host has 2 ips: 192.168.1.1 and 192.168.1.2 (as an ip alias).
By default outgoing traffic is on 192.168.1.1 - is it possible to tell a rootless container (actually slirp4netns), that 192.168.1.2 should be used as the src ip?
I would assume that this would need to be done be slirp4netns, but I wasn't able to find such an option.
thanks and best
mh _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Akihiro or Giuseppe any ideas?
Daniel Walsh <dwalsh@redhat.com> writes:
On 4/10/20 12:12, mh+podman@scrit.ch wrote:
Hi
assuming a host has 2 ips: 192.168.1.1 and 192.168.1.2 (as an ip alias).
By default outgoing traffic is on 192.168.1.1 - is it possible to tell a rootless container (actually slirp4netns), that 192.168.1.2 should be used as the src ip?
I would assume that this would need to be done be slirp4netns, but I wasn't able to find such an option.
thanks and best
mh _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Akihiro or Giuseppe any ideas?
it should be done in slirp4netns but that is not possible now. I don't see support for it in libslirp, so we'd first need to support binding to a device into libslirp. Giuseppe
Hi All,
Akihiro or Giuseppe any ideas?
it should be done in slirp4netns but that is not possible now. I don't see support for it in libslirp, so we'd first need to support binding to a device into libslirp.
Thank you for the update. The reasoning behind it would be to make it easily possible to recognize traffic from pods in the underlying network, similar to how EgressIPs do it in the k8s/OCP world. But looking more into (thought about filing an RFE with slirp4netns/libslirp) it seems, that this is already in progress: https://github.com/rootless-containers/slirp4netns/issues/173 https://gitlab.freedesktop.org/slirp/libslirp/issues/14 https://gitlab.freedesktop.org/slirp/libslirp/-/merge_requests/30 So it looks like the necessary plumbing seems to be done, now needs to expose the capability by slirb4netns and then later into podman. best mh
participants (4)
-
Daniel Walsh -
Giuseppe Scrivano -
mh -
mh+podman@scrit.ch