openshift / machine-config-operator

Apache License 2.0
245 stars 410 forks source link

baremetal: ipv6 breaks dhclient prepending DNS VIP #1371

Closed hardys closed 4 years ago

hardys commented 4 years ago

Currently we have a prepend option here:

https://github.com/openshift/machine-config-operator/blob/master/templates/master/00-master/baremetal/files/dhcp-dhclient-conf.yaml

prepend domain-name-servers {{ .Infra.Status.PlatformStatus.BareMetal.NodeDNSIP }};

This doesn't work when the DNS VIP is an IPv6 address, there's an error like this in the NetworkManager logs:

Jan 15 14:19:06 localhost dhclient[2445]: /var/lib/NetworkManager/dhclient-enp1s0.conf line 5: semicolon expected.
Jan 15 14:19:06 localhost dhclient[2445]: prepend domain-name-servers fd2e:
Jan 15 14:19:06 localhost dhclient[2445]:                                  ^
Jan 15 14:19:06 localhost dhclient[2445]: /var/lib/NetworkManager/dhclient-enp1s0.conf line 5: expecting a statement.
Jan 15 14:19:06 localhost dhclient[2445]: prepend domain-name-servers fd2e:6f44:5dd8:c956:0:0:0:2;
Jan 15 14:19:06 localhost dhclient[2445]:                                                         ^
Jan 15 14:19:06 localhost dhclient[2445]: /var/lib/NetworkManager/dhclient-enp1s0.conf line 8: semicolon expected.
Jan 15 14:19:06 localhost dhclient[2445]: option
Jan 15 14:19:06 localhost dhclient[2445]:  ^
Jan 15 14:19:06 localhost dhclient[2445]: /var/lib/NetworkManager/dhclient-enp1s0.conf line 12: no option named rfc3442-class>
Jan 15 14:19:06 localhost dhclient[2445]: also request rfc3442-classless-static-routes;
Jan 15 14:19:06 localhost dhclient[2445]:               ^
Jan 15 14:19:06 localhost dhclient[2445]: /var/lib/NetworkManager/dhclient-enp1s0.conf line 12: rfc3442-classless-static-rout>
Jan 15 14:19:06 localhost dhclient[2445]: also request rfc3442-classless-static-routes;
Jan 15 14:19:06 localhost dhclient[2445]:                                              ^
Jan 15 14:19:06 localhost dhclient[2448]: /var/lib/NetworkManager/dhclient-enp2s0.conf line 5: semicolon expected.
Jan 15 14:19:06 localhost dhclient[2448]: prepend domain-name-servers fd2e:
Jan 15 14:19:06 localhost dhclient[2448]:                                  ^
Jan 15 14:19:06 localhost dhclient[2448]: /var/lib/NetworkManager/dhclient-enp2s0.conf line 5: expecting a statement.
Jan 15 14:19:06 localhost dhclient[2448]: prepend domain-name-servers fd2e:6f44:5dd8:c956:0:0:0:2;
Jan 15 14:19:06 localhost dhclient[2448]:                                                         ^
Jan 15 14:19:06 localhost dhclient[2448]: /var/lib/NetworkManager/dhclient-enp2s0.conf line 8: semicolon expected.
Jan 15 14:19:06 localhost dhclient[2448]: option
Jan 15 14:19:06 localhost dhclient[2448]:  ^
Jan 15 14:19:06 localhost dhclient[2448]: /var/lib/NetworkManager/dhclient-enp2s0.conf line 12: no option named rfc3442-class>
Jan 15 14:19:06 localhost dhclient[2448]: also request rfc3442-classless-static-routes;
Jan 15 14:19:06 localhost dhclient[2448]:               ^
Jan 15 14:19:06 localhost dhclient[2448]: /var/lib/NetworkManager/dhclient-enp2s0.conf line 12: rfc3442-classless-static-rout>
Jan 15 14:19:06 localhost dhclient[2448]: also request rfc3442-classless-static-routes;
Jan 15 14:19:06 localhost dhclient[2448]: 

Looking at man dhcp-options it appears this should perhaps be like this for ipv6:

prepend dhcp6.name-servers fd2e:6f44:5dd8:c956:0:0:0:2;

However making this change manually doesn't prepend the :2 IP to the /etc/resolv.conf:

$ cat /etc/resolv.conf 
# Generated by NetworkManager
search ostest.test.metalkube.org
nameserver fd2e:6f44:5dd8:c956::1
hardys commented 4 years ago

/label platform/baremetal

openshift-ci-robot commented 4 years ago

@hardys: The label(s) platform/baremetal cannot be applied, because the repository doesn't have them

In response to [this](https://github.com/openshift/machine-config-operator/issues/1371#issuecomment-574760548): >/label platform/baremetal Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
hardys commented 4 years ago

/cc @celebdor @cybertron

openshift-bot commented 4 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot commented 4 years ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

cybertron commented 4 years ago

/close

We are no longer using dhclient for DNS prepending, so this won't be an issue anymore.

openshift-ci-robot commented 4 years ago

@cybertron: Closing this issue.

In response to [this](https://github.com/openshift/machine-config-operator/issues/1371#issuecomment-716648115): >/close > >We are no longer using dhclient for DNS prepending, so this won't be an issue anymore. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.