Openstack+Ceph 安装及配置-09.1-Openstack-Yoga 配置网络-Provider-Network
Openstack Yoga版本网络配置-Provider-Network
创建网络
[root@node-1 ~]# openstack network create --share --external --provider-physical-network provider --provider-network-type flat provider +---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | UP | | availability_zone_hints | | | availability_zones | | | created_at | 2022-03-02T03:31:48Z | | description | | | dns_domain | None | | id | 9c0c4a0c-59c5-4977-bf81-a62e75035ef6 | | ipv4_address_scope | None | | ipv6_address_scope | None | | is_default | None | | is_vlan_transparent | None | | mtu | 1500 | | name | provider | | port_security_enabled | True | | project_id | 9ddd4836df1c45f9bb41d78b97e27a24 | | provider:network_type | flat | | provider:physical_network | provider | | provider:segmentation_id | None | | qos_policy_id | None | | revision_number | 1 | | router:external | External | | segments | None | | shared | True | | status | ACTIVE | | subnets | | | tags | | | updated_at | 2022-03-02T03:31:48Z | +---------------------------+--------------------------------------+ [root@node-1 ~]# openstack network list +--------------------------------------+----------+---------+ | ID | Name | Subnets | +--------------------------------------+----------+---------+ | 9c0c4a0c-59c5-4977-bf81-a62e75035ef6 | provider | | +--------------------------------------+----------+---------+
参数说明
参数说明: --share 指明所有项目都可以使用这个网络,否则只有创建者能使用 --external 指明是外部网络 --provider-physical-network provider 指明物理网络的提供者,与下面neutron的配置文件对应,其中provider是标签,可以更改为其他,但是2个地方必须要统一
创建子网
[root@node-1 ~]# openstack subnet create --network provider --allocation-pool start=192.168.100.100,end=192.168.100.150 --dns-nameserver 210.21.196.6 --gateway 192.168.100.1 --subnet-range 192.168.100.0/24 provider-BD-192-168-100-0-24-subnet +----------------------+--------------------------------------+ | Field | Value | +----------------------+--------------------------------------+ | allocation_pools | 192.168.100.100-192.168.100.150 | | cidr | 192.168.100.0/24 | | created_at | 2022-03-02T03:51:22Z | | description | | | dns_nameservers | 210.21.196.6 | | dns_publish_fixed_ip | None | | enable_dhcp | True | | gateway_ip | 192.168.100.1 | | host_routes | | | id | 41f8c859-4732-4cc3-b62e-5ba0bc15a70d | | ip_version | 4 | | ipv6_address_mode | None | | ipv6_ra_mode | None | | name | provider-BD-192-168-100-0-24-subnet | | network_id | 9c0c4a0c-59c5-4977-bf81-a62e75035ef6 | | prefix_length | None | | project_id | 9ddd4836df1c45f9bb41d78b97e27a24 | | revision_number | 0 | | segment_id | None | | service_types | | | subnetpool_id | None | | tags | | | updated_at | 2022-03-02T03:51:22Z | +----------------------+--------------------------------------+ [root@node-1 ~]# openstack subnet list +--------------------------------------+-------------------------------------+--------------------------------------+------------------+ | ID | Name | Network | Subnet | +--------------------------------------+-------------------------------------+--------------------------------------+------------------+ | 41f8c859-4732-4cc3-b62e-5ba0bc15a70d | provider-BD-192-168-100-0-24-subnet | 9c0c4a0c-59c5-4977-bf81-a62e75035ef6 | 192.168.100.0/24 | +--------------------------------------+-------------------------------------+--------------------------------------+------------------+