Let's review the knowledge we discussed earlier.
When the tenant network is connected to the Neutron router, router is typically used as the default gateway.
When the router receives a packet of instance and forwards it to the external network:
1. Router will modify the source address of the package to its own extranet address, which ensures that packets are forwarded to the extranet and can be returned from the external network. 2. Router modifies the returned packet and forwards it to the real instance.
This behavior is known as Source NAT.
If you need to access instance directly from the extranet, you can take advantage of the floating IP.
Here are the facts about what floating IP must know:
1. Floating IP provides a static NAT function to establish a one-to-one mapping between the extranet IP and the instance tenant network IP. 2. The floating IP is configured on the extranet interface that router provides the gateway, not instance. 3. Router modifies the source or destination address of the packet according to the direction of the communication.
Below we study floating IP in depth through experiments.
Click the Access & Security menu, Compute, Project, to open the floating IPs tab.
Click on the "Allocate IP to Project" button.
Floating IP Pool is ext_net, click the "Allocate IP" button.
An IP 10.10.10.3 was successfully assigned from the Pool. Let's assign it to CIRROR-VM3 and click on the "Associate" button.
Select Cirror-vm3 in the drop-down list and click on the "Associate" button.
The assignment succeeds, and the floating IP 10.10.10.3 already corresponds to the CIRROS-VM3 tenant IP 172.16.101.3.
In the next section we will look at how the underlying network has changed and how the floating IP works.
Create floating IP-5 minutes a day to play with OpenStack (106)