You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following example configuration snippets demonstrate different methods of IP management.
9
+
The following example configuration snippets show different methods of IP management.
10
10
11
11
These examples use the `ethernet` interface type to simplify the example while showing the related context in the policy configuration. These IP management examples can be used with the other interface types.
12
12
@@ -109,8 +109,9 @@ For more information, see "Creating a manifest object that includes a customized
109
109
110
110
The following example shows a default situation that stores DNS values globally:
111
111
112
-
* Configure a static DNS without a network interface. Note that when updating the `/etc/resolv.conf` file on a host node, you do not need to specify an interface (IPv4 or IPv6) in the `NodeNetworkConfigurationPolicy` (NNCP) manifest.
112
+
* Configure a static DNS without a network interface. Note that when updating the `/etc/resolv.conf` file on a host node, you do not need to specify an interface, IPv4 or IPv6, in the `NodeNetworkConfigurationPolicy` (NNCP) manifest.
113
113
+
114
+
.Example of a DNS configuration for a network interface that globally stores DNS values
114
115
[source,yaml]
115
116
----
116
117
apiVersion: nmstate.io/v1
@@ -134,81 +135,79 @@ spec:
134
135
135
136
The following examples show situations that require configuring a network interface to store DNS values:
136
137
137
-
* Configure a static DNS for a network interface with an automatic IP configuration. Note that for this configuration, you must set the `auto-dns` parameter to `false`, so that the Kubernetes NMState Operator can store custom DNS settings for the network interface.
138
+
* If you want to rank a static DNS name server over a dynamic DNS name server, define the interface that runs either the Dynamic Host Configuration Protocol (DHCP) or the IPv6 Autoconfiguration (`autoconf`) mechanism in the network interface YAML configuration file.
138
139
+
140
+
.Example configuration that adds `192.0.2.1` to DNS name servers retrieved from the DHCPv4 network protocol
139
141
[source,yaml]
140
142
----
143
+
# ...
141
144
dns-resolver:
142
145
config:
143
-
search:
144
-
- example.com
145
-
- example.org
146
146
server:
147
-
- 2001:db8:f::1
148
-
- 192.0.2.251
147
+
- 192.0.2.1
149
148
interfaces:
150
149
- name: eth1
151
150
type: ethernet
152
151
state: up
153
152
ipv4:
154
153
enabled: true
155
154
dhcp: true
156
-
auto-dns: false
157
-
ipv6:
158
-
enabled: true
159
-
dhcp: true
160
-
autoconf: true
161
-
auto-dns: false
155
+
auto-dns: true
162
156
# ...
163
157
----
164
158
165
-
* Configure a static DNS for a network interface with a static IP configuration. Note that for this configuration, you must set the `dhcp` parameter to `false` and the `autoconf` parameter to `false`.
159
+
* If you need to configure a network interface to store DNS values instead of adopting the default method, which uses the `nmstate` API to store DNS values globally, you can set static DNS values and static IP addresses in the network interface YAML file.
166
160
+
161
+
[IMPORTANT]
162
+
====
163
+
Storing DNS values at the network interface level might cause name resolution issues after you attach the interface to network components, such as an Open vSwitch (OVS) bridge, a Linux bridge, or a bond.
164
+
====
165
+
+
166
+
.Example configuration that stores DNS values at the interface level
167
167
[source,yaml]
168
168
----
169
+
# ...
169
170
dns-resolver:
170
171
config:
171
-
# ...
172
+
search:
173
+
- example.com
174
+
- example.org
172
175
server:
173
-
- 2001:4860:4860::8844
174
-
- 192.0.2.251
176
+
- 2001:db8:1::d1
177
+
- 2001:db8:1::d2
178
+
- 192.0.2.1
175
179
interfaces:
176
180
- name: eth1
177
181
type: ethernet
178
182
state: up
179
183
ipv4:
180
-
enabled: true
181
-
dhcp: false
182
184
address:
183
185
- ip: 192.0.2.251
184
186
prefix-length: 24
185
-
ipv6:
186
-
enabled: true
187
187
dhcp: false
188
-
autoconf: false
188
+
enabled: true
189
+
ipv6:
189
190
address:
190
191
- ip: 2001:db8:1::1
191
192
prefix-length: 64
192
-
routes:
193
-
config:
194
-
- destination: 0.0.0.0/0
195
-
next-hop-address: 192.0.2.1
196
-
next-hop-interface: eth1
197
-
- destination: ::/0
198
-
next-hop-address: 2001:db8:1::3
199
-
next-hop-interface: eth1
193
+
dhcp: false
194
+
enabled: true
195
+
autoconf: false
200
196
# ...
201
197
----
202
198
203
-
* Configure a static DNS name server to append to Dynamic Host Configuration Protocol (DHCP) and IPv6 Stateless Address AutoConfiguration (SLAAC) servers.
199
+
* If you want to set static DNS search domains and dynamic DNS name servers for your network interface, define the dynamic interface that runs either the Dynamic Host Configuration Protocol (DHCP) or the IPv6 Autoconfiguration (`autoconf`) mechanism in the network interface YAML configuration file.
204
200
+
201
+
.Example configuration that sets `example.com` and `example.org` static DNS search domains along with dynamic DNS name server settings
0 commit comments