简体   繁体   English

无法从外部网络 ping OpenStack 机器的实例

[英]Cannot ping instances of OpenStack machine from external net

I used DevStack(victoria branch) to quick-deploy the OpenStack all-in-one on my Ubuntu-20.04 system.我使用 DevStack(维多利亚分支)在我的 Ubuntu-20.04 系统上快速部署 OpenStack 一体机。 This machine has a public ip address 222.XXX.XXX.XXX on interface eno1 , and the DevStack script has automatically added br-ex and virbr0 interfaces on this machine.本机在 eno1 接口上有一个公共的 ip 地址eno1 ,DevStack 脚本已经在本机上自动添加了br-exvirbr0接口。 Here is my config.这是我的配置。
#ifconfig
br-ex: inet 172.24.4.1 netmask 255.255.255.0 broadcast 0.0.0.0
eno1: inet 222.XXX.XXX.XXX netmask 255.255.255.128 broadcast 222.XXX.XXX.XXX
virbr0: inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
Now I created an VM instance on image cirros .现在我在图像cirros上创建了一个 VM 实例。 On my OpenStack dashboard, I created a private network demo-net of type vxlan, and it has a subnet 'demo-subnet', with the CIDR 10.56.1.0/24 and Gateway 10.56.1.1.在我的 OpenStack 仪表板上,我创建了一个 vxlan 类型的专用网络演示网,它有一个子网“演示子网”,CIDR 为 10.56.1.0/24,网关为 10.56.1.1。 The DHCP option is on. DHCP 选项已打开。
Meanwhile, DevStack has already created a public net with CIDR 172.24.4.0/24(bonded to br-ex ) and Gateway 172.24.4.1.同时,DevStack 已经创建了一个 CIDR 为 172.24.4.0/24(绑定到br-ex )和网关 172.24.4.1 的公共网络。
There is a router connecting the demo-net and public net.有一个路由器连接演示网公共网。
I allocated a floating IP 172.24.4.124 in the public net's pool to this instance.我在公共网络的池中分配了一个浮动 IP 172.24.4.124 给这个实例。 I can ping this IP on this machine, and vice versa.我可以在这台机器上ping这个IP,反之亦然。 But the problem is, when I ping 172.24.4.124 on another machine, it fails.但问题是,当我在另一台机器上 ping 172.24.4.124 时,它失败了。 I hope to access the VM instance outside the host, so what should I do to fix it?我希望访问主机外部的VM实例,那么我该怎么做才能修复它?
Any help will be greatly appreciated.任何帮助将不胜感激。 Thank you.谢谢你。

By default, Devstack creates an isolated "external" network which it calls public .默认情况下,Devstack 创建一个隔离的“外部”网络,它称为public You can only connect to this network, and all virtual networks that are attached to it, from the Devstack host.您只能从 Devstack 主机连接到该网络以及连接到该网络的所有虚拟网络。 You could try to configure port forwarding ( iptables command) on the Devstack host, but the real solution is below.您可以尝试在 Devstack 主机上配置端口转发( iptables命令),但真正的解决方案如下。

You need to configure Devstack so that it uses your external network 222.XXX.XXX.XXX.您需要配置 Devstack 以便它使用您的外部网络 222.XXX.XXX.XXX。 The way this is done is documented at https://docs.openstack.org/devstack/latest/networking.html#shared-guest-interface (assuming your Devstack host has a single NIC eno1 ).完成此操作的方式记录在https://docs.openstack.org/devstack/latest/networking.html#shared-guest-interface (假设您的 Devstack 主机有一个 NIC eno1 )。 In your case, you need to put this in local.conf:在你的情况下,你需要把它放在 local.conf 中:

PUBLIC_INTERFACE=eno1
HOST_IP=222.x.x.x
FLOATING_RANGE=222.x.y.z/PREFIX
PUBLIC_NETWORK_GATEWAY=your router, probably 222.something
Q_FLOATING_ALLOCATION_POOL=start=222.a.b.c,end=222.d.e.f

FLOATING_RANGE is the CIDR for the subnet to which eno1 is connected, and PREFIX is the prefix used by eno1 . FLOATING_RANGE 是eno1连接到的子网的 CIDR,而 PREFIX 是eno1使用的前缀。 Q_FLOATING_ALLOCATION_POOL is the range of IP addresses in the 222.xxx network that you want to use for floating IPs. Q_FLOATING_ALLOCATION_POOL 是您要用于浮动 IP 的 222.xxx 网络中的 IP 地址范围。

You will have to recreate a Devstack (although it might be possible to change the configuration of the current cloud, I would not know how).您将不得不重新创建一个 Devstack(尽管可能会更改当前云的配置,但我不知道如何)。 Before you do that, I would also strongly recommend reinstalling Ubuntu, to ensure no unwanted configurations from your current setup remain.在您这样做之前,我还强烈建议您重新安装 Ubuntu,以确保不会保留当前设置中不需要的配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法从外部计算机连接到Openstack实例 - Not able to connect to a Openstack Instance from external machine 无法从主机ping docker容器 - Cannot ping docker container from the host machine 如何从外部网络访问本地计算机上的Openstack? - How to Access Openstack on my local machine from External network? Java DatagramChannel-无法从外部网络ping端口 - Java DatagramChannel - Cannot ping port from external network Openstack nova:无法访问虚拟机 - Openstack nova: cannot reach virtual machine 为什么我在使用macvlan时无法通过其主机名从外部计算机ping容器? - Why I can't ping container by its hostname, from an external machine, while using macvlan? 一体机 Openstack 实例网络无法与 LAN 网络通信 - 外部虚拟机 ping 正常 - 虚拟机外部/互联网 ping 不正常 - All-in-One Openstack instance network not communicate to LAN network - External-VM ping OK - VM-External/Internet ping NOT OK 从网络中的另一台机器 Ping Docker 容器 - Ping Docker Container from another machine in the network 从主机 Ping 虚拟机显示“目标主机无法访问” - Ping a virtualbox machine from the host machine shows “Destination Host Unreachable” OpenStack实例的端口转发 - Port Forwarding for OpenStack Instances
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM