18.3.6.3. 动态主机配置

以下片段配置了一个以太网接口,它使用动态 IP 地址、网关地址和 DNS:

...
    interfaces:
    - name: eth1
      description: DHCP on eth1
      type: ethernet
      state: up
      ipv4:
        dhcp: true
        enabled: true
...

以下片段配置了一个以太网接口,它使用动态 IP 地址,但不使用动态网关地址或 DNS:

...
    interfaces:
    - name: eth1
      description: DHCP without gateway or DNS on eth1
      type: ethernet
      state: up
      ipv4:
        dhcp: true
        auto-gateway: false
        auto-dns: false
        enabled: true
...