建立 floating IP - 天天5分钟玩转 OpenStack(106)

先复习一下前面咱们讨论的知识。网络

当租户网络链接到 Neutron router,一般将 router 做为默认网关。
当 router 接收到 instance 的数据包,并将其转发到外网时:学习

1. router 会修改包的源地址为本身的外网地址,这样确保数据包转发到外网,并可以从外网返回。
2. router 修改返回的数据包,并转发给真正的 instance。spa

这个行为被称做 Source NATrouter

若是须要从外网直接访问 instance,则能够利用 floating IP。
下面是关于 floating IP 必须知道的事实:ci

1. floating IP 提供静态 NAT 功能,创建外网 IP 与 instance 租户网络 IP 的一对一映射。
2. floating IP 是配置在 router 提供网关的外网 interface 上的,而非 instance 中。
3. router 会根据通讯的方向修改数据包的源或者目的地址。it

下面咱们经过实验深刻学习 floating IP。
点击 Project -> Compute -> Access & Security 菜单,打开 Floating IPs 标签页。配置

点击 “Allocate IP To Project” 按钮。route

floating IP Pool 为 ext_net,点击 “Allocate IP” 按钮。sso

从 Pool 中成功分配了一个 IP 10.10.10.3。 下面咱们将它分配给 cirror-vm3,点击 “Associate” 按钮。float

在下拉列表中选择 cirror-vm3,点击 “Associate” 按钮。

分配成功,floating IP 10.10.10.3 已经对应到 cirros-vm3 的租户 IP 172.16.101.3。

下一节咱们将观察底层网络发生了怎样的变化,并分析 floating IP 是如何工做的。

 

blob.png

相关文章
相关标签/搜索