OpenStack中子-作为同一租户内两个网络之间的路由器的虚拟机 [英] Openstack Neutron - VM as a router between two networks within the same tenant

查看:18
本文介绍了OpenStack中子-作为同一租户内两个网络之间的路由器的虚拟机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下设置:

VM1-Net1-VM2-NET2-VM3

VM2可以ping通VM1和VM3。然而,当从VM1 ping VM3时,数据包由VM2转发,但永远不会到达VM3(即,它们被NET2丢弃,因为tcpump显示数据包从VM2的NET2接口发出)。

从VM3 ping VM1时相同。数据包到达VM2,然后VM2将它们转发到V1,但它们永远不会到达VM1。

看起来NET2不允许带有Net1的srcIP的数据包通过。Net1过滤srcIP为NET2的数据包也是如此。

这是我们在热模板中创建每个网络的方式。

net1:
   type: OS::Neutron::Net
   properties:
      name: net1_name

net1_subnet:
   type: OS::Neutron::Subnet
   properties:
     network_id: { get_resource: net1 }
     cidr: { get_param: net1_cidr }

有没有办法使数据包通过充当路由器的VM2从Net1流向NET2?

谢谢!

=更新=

看起来我找到了一个解决方案:将VM1和VM3的IP添加到VM2的端口(中子:端口)的允许_地址_对中。

VM2_left_port:
    type: OS::Neutron::Port
    properties:
       allowed_address_pairs: [{"ip_address": { get_param: VM3_IP}}]
       network: ...
       fixed_ips: ...

VM2_right_port:
    type: OS::Neutron::Port
    properties:
       allowed_address_pairs: [{"ip_address": { get_param: VM1_IP }}]
       network: ...
       fixed_ips: ...

允许在目标网络之间进行路由(使用VM2作为路由器)是否正确的问题。

推荐答案

所以问题实际上是OpenStack的"端口安全"功能,它会阻止从一个子网到另一个子网的流量。为了允许数据包流于子网之间,可以使用以下选项作为我在问题中提出的方法("Allowed_Address_Pair")的替代方案。

VM2_left_port:
    type: OS::Neutron::Port
    properties:
       security_groups: []
       port_security_enabled: False
       network: ...
       fixed_ips: ...

VM2_right_port:
    type: OS::Neutron::Port
    properties:
       security_groups: []
       port_security_enabled: False
       network: ...
       fixed_ips: ...

这篇关于OpenStack中子-作为同一租户内两个网络之间的路由器的虚拟机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆