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

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.


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值