next up previous contents
Next: 驗證 Up: Virtual Network Previous: Self-service Network   Contents

Router

  1. Self-service network 以 virtual router 連線到對外的 provider network,provider network 欄位 router:external 必須是 external,才可以讓 selfservice network 經由 provider network 對外,這由產生 provider network 時以參數 -external 達成。
  2. 以一般用戶 demo 產生 router,載入一般用戶 demo 環境變變數。
    [root@controller ~]# . demo.token
    
  3. 新增 router。
    [root@controller ~]# openstack router create router
    +-------------------------+--------------------------------------+
    | Field                   | Value                                |
    +-------------------------+--------------------------------------+
    | admin_state_up          | UP                                   |
    | availability_zone_hints |                                      |
    | availability_zones      |                                      |
    | created_at              | 2018-05-26T08:07:54Z                 |
    | description             |                                      |
    | distributed             | False                                |
    | external_gateway_info   | None                                 |
    | flavor_id               | None                                 |
    | ha                      | False                                |
    | id                      | 3ce2307f-d558-4aa3-b723-8e71ed990824 |
    | name                    | router                               |
    | project_id              | 92d1ec3e04384ad599c1a8f5aed73663     |
    | revision_number         | 1                                    |
    | routes                  |                                      |
    | status                  | ACTIVE                               |
    | tags                    |                                      |
    | updated_at              | 2018-05-26T08:07:54Z                 |
    +-------------------------+--------------------------------------+
    
  4. 查詢 router,新增的為 3ce2307f-d558-4aa3-b723-8e71ed990824。
    [root@controller ~]# openstack router list
    +--------------------------------------+--------+--------+-------+
    | ID                                   | Name   | Status | State |
    +--------------------------------------+--------+--------+-------+
    | 3ce2307f-d558-4aa3-b723-8e71ed990824 | router | ACTIVE | UP    |
    | 53bc7576-bcee-4ad4-ae06-d18d9be372a2 | router | ACTIVE | UP    |
    +--------------------------------------+--------+--------+-------+
    -------------+-------+----------------------------------+
     Distributed | HA    | Project                          |
    -------------+-------+----------------------------------+
     False       | False | 92d1ec3e04384ad599c1a8f5aed73663 |
     False       | False | 92d1ec3e04384ad599c1a8f5aed73663 |
    -------------+-------+----------------------------------+
    
  5. 新增 selfservice 的 subnet 到 router 3ce2307f-d558-4aa3-b723-8e71ed990824。
    [root@controller ~]# openstack router add subnet \
    3ce2307f-d558-4aa3-b723-8e71ed990824 selfservice
    
  6. 設定 router 3ce2307f-d558-4aa3-b723-8e71ed990824 對外 gateway 為 provider network。
    [root@controller ~]# openstack router set \
    3ce2307f-d558-4aa3-b723-8e71ed990824 --external-gateway provider
    



De-Yu Wang 2018-12-12