1. 程式人生 > >neutron命令列建立路由

neutron命令列建立路由

路由建立屬於網路部分,所以只能是neutron模組可以完成,路由的具體建立步驟如下:

1.  建立路由命令:

(neutron-server)[[email protected] /]$ neutron router-create onlyone


可以看見,onlyone的路由建立成功,其id=481b4902-2b3-4fec-a757-d90688b73558 。可檢視其資訊:




下面繼續配置子網,使子網連線到路由

2. 檢視當前子網:

(neutron-server)[[email protected] /]$ neutron net-list


這裡以  fly-net為例。

3.  新增子網(subnet)到路由,注意這裡是子網,是subnets這一列(最後一列):

(neutron-server)[[email protected] /]$ neutron router-interface-add \ 

481b4902-2b3-4fec-a757-d90688b73558 \  #路由id

92e158f7-0771-4fa3-ad36-e67e5608d151   # 子網subnet id


說明新增子網成功!



附錄:

(neutron-server)[

[email protected] /]$ neutron  help  |egrep  router
  l3-agent-list-hosting-router      List L3 agents hosting a router.
  l3-agent-router-add               Add a router to a L3 agent.
  l3-agent-router-remove            Remove a router from a L3 agent.
  net-gateway-connect               Add an internal network interface to a router.
  router-create                     Create a router for a given tenant.
  router-delete                     Delete a given router.
  router-gateway-clear              Remove an external network gateway from a router.
  router-gateway-set                Set the external network gateway for a router.
  router-interface-add              Add an internal network interface to a router.
  router-interface-delete           Remove an internal network interface from a router.
  router-list                       List routers that belong to a given tenant.
  router-list-on-l3-agent           List the routers on a L3 agent.
  router-port-list                  List ports that belong to a given tenant, with specified router.
  router-show                       Show information of a given router.
  router-update                     Update router's information.