XhstormR
查询路由
[root@station140 ~(keystone_admin)]# neutron router-list | grep -v router1
+--------------------------------------+------------+------------------------+
| id | name | external_gateway_info |
+--------------------------------------+------------+------------------------+
| b83f43cd-bf8f-42f8-812a-708c2c372820 | ext-to-int | null |
+--------------------------------------+------------+------------------------+
查询网络
[root@station140 ~(keystone_admin)]# neutron net-list | grep pub1
+--------------------------------------+---------+------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+---------+------------------------------------------------------+
| aebe75f0-6013-4a5e-bbd9-cb81e1f017bc | pub1 | 59cc431b-498e-49a0-bc60-4a8ca1ca6f48 192.168.48.0/24 |
+--------------------------------------+---------+------------------------------------------------------+
设定网络
[root@station140 ~(keystone_admin)]# neutron router-gateway-set b83f43cd-bf8f-42f8-812a-708c2c372820 aebe75f0-6013-4a5e-bbd9-cb81e1f017bc
查看设置
[root@station140 ~(keystone_admin)]# neutron router-list | grep -v router1
+--------------------------------------+------------+-----------------------------------------------------------------------------+
| id | name | external_gateway_info |
+--------------------------------------+------------+-----------------------------------------------------------------------------+
| b83f43cd-bf8f-42f8-812a-708c2c372820 | ext-to-int | {"network_id": "aebe75f0-6013-4a5e-bbd9-cb81e1f017bc", "enable_snat": true} |
+--------------------------------------+------------+-----------------------------------------------------------------------------+望采纳。