第 10 章 配置 overcloud 网络
要为 overcloud 配置物理网络,请创建以下配置文件:
-
网络配置文件
network_data.yaml
,它遵循网络数据模式中定义的结构。 -
网络接口控制器(NIC)配置文件,方法是使用 Jinja2 ansible 格式的 NIC 模板文件
j2
。
10.1. 网络配置文件示例
以下是 IPv4 和 IPv6 的网络数据模式示例。
10.1.1. IPv4 的网络数据模式示例
- name: Storage name_lower: storage #optional, default: name.lower admin_state_up: false #optional, default: false dns_domain: storage.localdomain. #optional, default: undef mtu: 1442 #optional, default: 1500 shared: false #optional, default: false service_net_map_replace: storage #optional, default: undef ipv6: false #optional, default: false vip: true #optional, default: false subnets: subnet01: ip_subnet: 172.18.1.0/24 gateway_ip: 172.18.1.254 #optional, default: undef allocation_pools: #optional, default: [] - start: 172.18.1.10 end: 172.18.1.250 enable_dhcp: false #optional, default: false routes: #optional, default: [] - destination: 172.18.0.0/24 nexthop: 172.18.1.254 vlan: 21 #optional, default: undef physical_network: storage_subnet01 #optional, default: {{name.lower}}_{{subnet name}} network_type: flat #optional, default: flat segmentation_id: 21 #optional, default: undef subnet02: ip_subnet: 172.18.0.0/24 gateway_ip: 172.18.0.254 #optional, default: undef allocation_pools: #optional, default: [] - start: 172.18.0.10 end: 172.18.0.250 enable_dhcp: false #optional, default: false routes: #optional, default: [] - destination: 172.18.1.0/24 nexthop: 172.18.0.254 vlan: 20 #optional, default: undef physical_network: storage_subnet02 #optional, default: {{name.lower}}_{{subnet name}} network_type: flat #optional, default: flat segmentation_id: 20 #optional, default: undef
10.1.2. IPv6 的网络数据模式示例
- name: Storage name_lower: storage admin_state_up: false dns_domain: storage.localdomain. mtu: 1442 shared: false ipv6: true vip: true subnets: subnet01: ipv6_subnet: 2001:db8:a::/64 gateway_ipv6: 2001:db8:a::1 ipv6_allocation_pools: - start: 2001:db8:a::0010 end: 2001:db8:a::fff9 enable_dhcp: false routes_ipv6: - destination: 2001:db8:b::/64 nexthop: 2001:db8:a::1 ipv6_address_mode: null ipv6_ra_mode: null vlan: 21 physical_network: storage_subnet01 #optional, default: {{name.lower}}_{{subnet name}} network_type: flat #optional, default: flat segmentation_id: 21 #optional, default: undef subnet02: ipv6_subnet: 2001:db8:b::/64 gateway_ipv6: 2001:db8:b::1 ipv6_allocation_pools: - start: 2001:db8:b::0010 end: 2001:db8:b::fff9 enable_dhcp: false routes_ipv6: - destination: 2001:db8:a::/64 nexthop: 2001:db8:b::1 ipv6_address_mode: null ipv6_ra_mode: null vlan: 20 physical_network: storage_subnet02 #optional, default: {{name.lower}}_{{subnet name}} network_type: flat #optional, default: flat segmentation_id: 20 #optional, default: undef