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

Support dnsname plugin in networks created with internal flag (support isDefaultGateway) #8483

Closed
cfelder opened this issue Nov 25, 2020 · 10 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@cfelder
Copy link
Contributor

cfelder commented Nov 25, 2020

Currently dnsname plugins don't work when using internal

podman network create --internal

because the cni network is configured with "isGateway": false and "isDefaultGateway": false is hard coded to false in the following line

bridge := NewHostLocalBridge(bridgeDeviceName, isGateway, false, ipMasq, ipamConfig)

This has the following result:

  1. a new cni interface, e.g. cni-podman1 but with no ip address assigned to it
  2. a dnsmasq running for that network (running on the host but not reachable from the new cni because of 1)

To resolve this issue it is possible to manually edit the cni network conflist file to use the following config:

"isGateway": true,
"isDefaultGateway": false,

Afterwards name resolution works and routing packets doesn't as expected because of the missing default route. Adding this route in the root container is prohibited (👍 ) as well.

$ ip route add default via 10.88.3.1
RTNETLINK answers: Operation not permitted

Furthermore all cni networks are currently using the same dns zone dns.podman which is problematic when using multiple cni's in one container. It would be better to have different zones for different networks or to allow explicitly setting the name of the zone.

I am not sure you want to change the defaults because of backward compatibility but it would be nice to set isGateway to true and add a isDefaultGateway flag here which is set to false

if options.Internal {
isGateway = false
ipMasq = false
}

@cfelder
Copy link
Contributor Author

cfelder commented Nov 25, 2020

CC: @Luap99 and thanks for your help on irc.

@Luap99 Luap99 added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 25, 2020
@Luap99
Copy link
Member

Luap99 commented Nov 25, 2020

I guess this would be a good candidate for a network option after #8457 is merged

@Luap99
Copy link
Member

Luap99 commented Nov 25, 2020

Maybe something like podman network create --opt defaultGateway=false

@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Dec 28, 2020

@Luap99 Any progress on this? @cfelder Does the suggested fix work for you? Interested in opening a PR to implement it?

@Luap99
Copy link
Member

Luap99 commented Dec 28, 2020

I did more testing and it looks like setting isGateway to true for a internal network is not secure at all. The default route is always added. The isDefaultGateway option doesn't do anything since it defaults to false.

@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Jan 29, 2021

@Luap99 can we close this issue now?

@Luap99
Copy link
Member

Luap99 commented Jan 29, 2021

Yes we cannot support this with the current dnsname architecture. We now print a warning if you create a internal network with the dnsname plugin.

@Luap99 Luap99 closed this as completed Jan 29, 2021
@w4tsn
Copy link
Contributor

w4tsn commented Jun 7, 2021

Is there any workaround for this? As I understand, it's currently not possible to use dns name resolution for rootful containers in a cni network created as "internal", right?

So how to address a container from another container on the same network but without using pods, if the IP is assigned in an unpredictable way?

I'm asking because I have two rootful containers in an internal network and one of them is supposed to access a port on the other but the name resolution fails and I can't use a fixed IP address because A) the IP address of rootful containers can't be fixed (right?) B) I'm trying to get docker-compose working which in turn allows setting the IP address of those containers which is not supported right now by the podman API socket I guess? I opened an issue about that specifically #10585

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
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. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

4 participants