next up previous contents
Next: Virtual Network Up: Neutron Previous: 驗證   Contents

重設 subnet pools

  1. 載入管理者環境變變數。
    [root@controller ~]# . admin.token
    
  2. 列出 network,provider network 的 Subnets 是 2a7287d7-4a4f-43cc-beb2-bc9c023af929。
    [root@controller ~]# openstack network list
    +--------------------------------------+-------------+--------------------------------------+
    | ID                                   | Name        | Subnets                              |
    +--------------------------------------+-------------+--------------------------------------+
    | 0b0ebcee-057b-4798-bf73-5dd449e7879a | provider    | 2a7287d7-4a4f-43cc-beb2-bc9c023af929 |
    | 37d0dee7-d573-4f3b-863d-c92c05b6dbbb | selfservice | 36c70394-9a28-4cdf-bfee-9c65f4512027 |
    +--------------------------------------+-------------+--------------------------------------+
    
  3. subnet show 查看 2a7287d7-4a4f-43cc-beb2-bc9c023af929 的 IP 範圍為 163.17.10.113 至163.17.10.200。
    [root@controller ~]# openstack subnet show 2a7287d7-4a4f-43cc-beb2-bc9c023af929
    +-------------------+--------------------------------------+
    | Field             | Value                                |
    +-------------------+--------------------------------------+
    | allocation_pools  | 163.17.10.113-163.17.10.200          |
    | cidr              | 163.17.10.0/24                       |
    | created_at        | 2018-05-26T07:32:01Z                 |
    | description       |                                      |
    | dns_nameservers   | 8.8.8.8                              |
    | enable_dhcp       | True                                 |
    | gateway_ip        | 163.17.10.254                        |
    | host_routes       |                                      |
    | id                | 2a7287d7-4a4f-43cc-beb2-bc9c023af929 |
    | ip_version        | 4                                    |
    | ipv6_address_mode | None                                 |
    | ipv6_ra_mode      | None                                 |
    | name              | provider                             |
    | network_id        | 0b0ebcee-057b-4798-bf73-5dd449e7879a |
    | project_id        | e28adc716118434c96b5833867faa08c     |
    | revision_number   | 0                                    |
    | segment_id        | None                                 |
    | service_types     |                                      |
    | subnetpool_id     | None                                 |
    | tags              |                                      |
    | updated_at        | 2018-05-26T07:32:01Z                 |
    +-------------------+--------------------------------------+
    
  4. unset subnet 2a7287d7-4a4f-43cc-beb2-bc9c023af929 的 allocation_pools
    [root@controller ~]# openstack subnet unset --allocation-pool \
    start=163.17.10.113,end=163.17.10.200 2a7287d7-4a4f-43cc-beb2-bc9c023af929
    
  5. 再設定 subnet 2a7287d7-4a4f-43cc-beb2-bc9c023af929 的 IP 範圍為 163.17.10.113 至163.17.10.121。
    [root@controller ~]# openstack subnet set --allocation-pool start=163.17.10.113,end=163.17.10.121 2a7287d7-4a4f-43cc-beb2-bc9c023af929
    
  6. subnet show 再查看 2a7287d7-4a4f-43cc-beb2-bc9c023af929 的 IP 範圍為 163.17.10.113 至163.17.10.121。
    [root@controller ~]# openstack subnet show 2a7287d7-4a4f-43cc-beb2-bc9c023af929
    +-------------------+--------------------------------------+
    | Field             | Value                                |
    +-------------------+--------------------------------------+
    | allocation_pools  | 163.17.10.113-163.17.10.121          |
    | cidr              | 163.17.10.0/24                       |
    | created_at        | 2018-05-26T07:32:01Z                 |
    | description       |                                      |
    | dns_nameservers   | 8.8.8.8                              |
    | enable_dhcp       | True                                 |
    | gateway_ip        | 163.17.10.254                        |
    | host_routes       |                                      |
    | id                | 2a7287d7-4a4f-43cc-beb2-bc9c023af929 |
    | ip_version        | 4                                    |
    | ipv6_address_mode | None                                 |
    | ipv6_ra_mode      | None                                 |
    | name              | provider                             |
    | network_id        | 0b0ebcee-057b-4798-bf73-5dd449e7879a |
    | project_id        | e28adc716118434c96b5833867faa08c     |
    | revision_number   | 2                                    |
    | segment_id        | None                                 |
    | service_types     |                                      |
    | subnetpool_id     | None                                 |
    | tags              |                                      |
    | updated_at        | 2018-11-06T08:26:49Z                 |
    +-------------------+--------------------------------------+
    


De-Yu Wang 2018-11-06