您现在的位置是:首页 > 文章详情

openstack 下网络[路由绑定]故障解决

日期:2015-01-18点击:772

1. 查询网络信息

[root@kf-test-pinyun-048228 ~(keystone_admin)]# neutron net-list | grep w2 | 01a7ab13-65a8-4300-a53b-d6a774414c2a | w2 | 67f3da0b-a513-4857-8ad7-2283494a3b4f 192.168.0.0/24 |



2. 查询子网信息

[root@kf-test-pinyun-048228 ~(keystone_admin)]# neutron subnet-list | grep 67f3da0b-a513-4857-8ad7-2283494a3b4f | 67f3da0b-a513-4857-8ad7-2283494a3b4f | 2 | 192.168.0.0/24 | {"start": "192.168.0.21", "end": "192.168.0.200"} |


3. 查询当前路由信息

[root@kf-test-pinyun-048228 ~(keystone_admin)]#neutron router-list | grep ly2 | 698a3113-e94d-4c5a-ba62-870c9c7897bc | ly2 | {"network_id": "c3d7ba94-4360-4f3f-a9c8-83cda089dfa7", "enable_snat": true} |


4. 添加网络接口

[root@kf-test-pinyun-048228 ~(keystone_admin)]#neutron router-list | grep ly2 | 698a3113-e94d-4c5a-ba62-870c9c7897bc | ly2 | {"network_id": "c3d7ba94-4360-4f3f-a9c8-83cda089dfa7", "enable_snat": true} | [root@kf-test-pinyun-048228 ~(keystone_admin)]#neutron router-interface-add 698a3113-e94d-4c5a-ba62-870c9c7897bc 67f3da0b-a513-4857-8ad7-2283494a3b4f 400-{u'NeutronError': {u'message': u'Bad router request: Subnet for router interface must have a gateway IP', u'type': u'BadRequest', u'detail': u''}}



检查原因

[root@kf-test-pinyun-048228 ~(keystone_admin)]# neutron subnet-show 2 +------------------+---------------------------------------------------+ | Field | Value | +------------------+---------------------------------------------------+ | allocation_pools | {"start": "192.168.0.21", "end": "192.168.0.200"} | | cidr | 192.168.0.0/24 | | dns_nameservers | | | enable_dhcp | True | | gateway_ip | | <-- 没有路由导致无法连接该路由 | host_routes | | | id | 67f3da0b-a513-4857-8ad7-2283494a3b4f | | ip_version | 4 | | name | 2 | | network_id | 01a7ab13-65a8-4300-a53b-d6a774414c2a | | tenant_id | 491b8025e52b4876a4c92e34faab6de9 | +------------------+---------------------------------------------------+


重新创建一个子网

[root@kf-test-pinyun-048228 ~(keystone_admin)]# neutron subnet-delete 2 Deleted subnet: 2 [root@kf-test-pinyun-048228 ~(keystone_admin)]#neutron subnet-create --name terry_subnet --allocation-pool start=192.168.0.21,end=192.168.0.200 --gateway 192.168.0.1 --dns-nameserver 192.168.86.37 --enable_dhcp=True --ip-version 4 w2 192.168.0.0/24 Created a new subnet: +------------------+---------------------------------------------------+ | Field | Value | +------------------+---------------------------------------------------+ | allocation_pools | {"start": "192.168.0.21", "end": "192.168.0.200"} | | cidr | 192.168.0.0/24 | | dns_nameservers | 192.168.86.37 | | enable_dhcp | True | | gateway_ip | 192.168.0.1 | | host_routes | | | id | 22515256-2d5e-4e97-b8d4-4dd00a2a4595 | | ip_version | 4 | | name | terry_subnet | | network_id | 01a7ab13-65a8-4300-a53b-d6a774414c2a | | tenant_id | 96536b80f74a4aea90d728befa0d1114 | +------------------+---------------------------------------------------+


重新连接路由成功, 问题解决

[root@kf-test-pinyun-048228 ~(keystone_admin)]#neutron router-interface-add 698a3113-e94d-4c5a-ba62-870c9c7897bc 22515256-2d5e-4e97-b8d4-4dd00a2a4595 Added interface ad53878a-f358-4867-bbf5-3d1fd3302e6c to router 698a3113-e94d-4c5a-ba62-870c9c7897bc.


原文链接:https://yq.aliyun.com/articles/70856
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章