vinfra service compute floatingip create
Create a floating IP address:
usage: vinfra service compute floatingip create [--floating-ip <floating-ip>] [--port-id <port-id>] [--fixed-ip <fixed-ip>] [--description <description>] --network <network>
--floating-ip <floating-ip>
- Floating IP address
--port-id <port-id>
- ID of the port to be associated with the floating IP address. To learn the port ID of the selected virtual machine, use the command vinfra service compute server iface list.
--fixed-ip <fixed-ip>
- Port IP address (required only if the port has multiple IP addresses)
--description <description>
- Description of the floating IP address
--network <network>
- ID or name of the network from which to allocate the floating IP
Example:
# vinfra service compute floatingip create 720e45bc-4225-49de-9346-26513d8d1262 \ --port-id 418c8c9e-aaa5-42f2-8da7-24bfead6f28b --fixed-ip-address 192.168.128.5 +---------------------+--------------------------------------+ | Field | Value | +---------------------+--------------------------------------+ | attached_to | a172cb6a-1c7b-4157-9e86-035f3077646f | | description | | | fixed_ip_address | 192.168.128.5 | | floating_ip_address | 10.94.129.72 | | floating_network_id | 720e45bc-4225-49de-9346-26513d8d1262 | | id | a709f884-c43f-4a9a-a243-a340d7682ef8 | | port_id | 418c8c9e-aaa5-42f2-8da7-24bfead6f28b | | project_id | 894696133031439f8aaa7e4868dcbd4d | | router_id | f7f86029-a553-4d61-b7ec-6f581d9c5f5f | | status | DOWN | +---------------------+--------------------------------------+
This command creates a floating IP address from the physical network with the ID 720e45bc-4225-49de-9346-26513d8d1262
and assigns it to a virtual machine on port with the ID 418c8c9e-aaa5-42f2-8da7-24bfead6f28b
and the virtual IP address 192.168.128.5
.