This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.
11.2.6.3. 动态主机配置
以下片段配置了一个以太网接口,它使用动态 IP 地址、网关地址和 DNS:
...
interfaces:
- name: eth1
description: DHCP on eth1
type: ethernet
state: up
ipv4:
dhcp: true
enabled: true
...
...interfaces:-name: eth1
description: DHCP on eth1
type: ethernet
state: up
ipv4:dhcp:trueenabled:true...
Copy to ClipboardCopied!Toggle word wrapToggle overflow
以下片段配置了一个以太网接口,它使用动态 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
...
...interfaces:-name: eth1
description: DHCP without gateway or DNS on eth1
type: ethernet
state: up
ipv4:dhcp:trueauto-gateway:falseauto-dns:falseenabled:true...
Copy to ClipboardCopied!Toggle word wrapToggle overflow