Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to name network interface inside container same as the respective podman network interface name or its parent by default #13174

Closed
vikas-goel opened this issue Feb 9, 2022 · 23 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. network Networking related issue or feature

Comments

@vikas-goel
Copy link
Contributor

vikas-goel commented Feb 9, 2022

Docker allows to customer network interface name inside containers using com.docker.network.container_iface_prefix option. Docker Compose too supports it.

How can same be done with Podman when used with Docker Compose?

Will be good to have containers.conf option, say interface_name = network|parent to make that default.

@Luap99
Copy link
Member

Luap99 commented Feb 9, 2022

We do not support any docker specific option via the compat api yet. It should be possible to map some of those to the podman options.
The network create backend does support setting a specific interface name but it does not support a prefix so I am not sure how we should map this.

@Luap99 Luap99 added kind/feature Categorizes issue or PR as related to a new feature. network Networking related issue or feature labels Feb 9, 2022
@vikas-goel
Copy link
Contributor Author

vikas-goel commented Feb 9, 2022

The network create backend does support setting a specific interface name

What is the command to achieve this? Is it specific to a particular driver or generic?

@Luap99
Copy link
Member

Luap99 commented Feb 9, 2022

You can use podman run --network mynet:interface_name=eth0 ... So you have to set the specific name not a prefix. So it is not exactly the same as docker.

@mheon
Copy link
Member

mheon commented Feb 9, 2022

I wonder if this is something that would be appropriate for containers.conf

@vikas-goel
Copy link
Contributor Author

You can use podman run --network mynet:interface_name=eth0 ... So you have to set the specific name not a prefix. So it is not exactly the same as docker.

This podman option works better for me. Just that Docker Compose fails to recognize it. As @mheon suggested, it will be great if we can make it the default behavior by means of containers.conf.

@vikas-goel
Copy link
Contributor Author

vikas-goel commented Feb 9, 2022

Just to be clear on the ask:
When set a property in containers.conf, say interface_name = “network”, the network interface name inside the container should be same as the respective network name used with --network option.

@vikas-goel
Copy link
Contributor Author

Hi @Luap99 ,
Can this change be available in 4.0?

@Luap99
Copy link
Member

Luap99 commented Feb 12, 2022

I don't think so. This is definitely more complex to implement.

@rhatdan
Copy link
Member

rhatdan commented Feb 14, 2022

We are not adding features to podman 4.0 at this point, It should release later this week.
This would show up no earlier then 4.1.

@vikas-goel vikas-goel changed the title Podman equivalent of com.docker.network.container_iface_prefix Option to name network interface inside container same as the respective podman network interface name or its parent by default Feb 14, 2022
@Luap99
Copy link
Member

Luap99 commented Feb 15, 2022

The problem with interface_name = "network" is that this will fail if the name contains invalid characters or is longer than 15 chars since the kernel has this limitation for interface names.

@vikas-goel
Copy link
Contributor Author

For my use case, either of parent and network will work as the network name is same as parent. If “parent” makes it easy, that’s fine too.

@Luap99
Copy link
Member

Luap99 commented Feb 15, 2022

What does "parent" means, the interface name on host?

@vikas-goel
Copy link
Contributor Author

Yes

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Mar 19, 2022

@Luap99 @vikas-goel Any movement on this Issue?

@Luap99
Copy link
Member

Luap99 commented Mar 21, 2022

Not from my side, I don't think this has a high priority.

@vikas-goel
Copy link
Contributor Author

I was hoping it to be available in 4.1 as per earlier discussion. Is that plan still in place?

@vikas-goel
Copy link
Contributor Author

Just checking the timeline for this one to be available?

@mheon
Copy link
Member

mheon commented Apr 1, 2022

This isn't prioritized at present, so no one is actively working on it or planning to work on it; I'd suggest opening a Bugzilla if you'd like to have it prioritized. Earliest likely date in that case would be Podman 4.1, for RHEL 8.6.0.2.

@Luap99
Copy link
Member

Luap99 commented Apr 1, 2022

Also this is an open source project, anyone can implement the changes. I am always happy to review community PRs.

@vikas-goel
Copy link
Contributor Author

To enable this capability, is the change going to be limited to "podman" project or does it extend to some external dependencies too?

@vikas-goel
Copy link
Contributor Author

@mheon , raised a Bugzilla a while ago. Is there any update?

@baude
Copy link
Member

baude commented Apr 27, 2022

closing this in favor of the bugzilla.

@baude baude closed this as completed Apr 27, 2022
@containers containers locked and limited conversation to collaborators Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. network Networking related issue or feature
Projects
None yet
Development

No branches or pull requests

5 participants