Ask Your Question
0

Add multiple IPs to instance

asked 2017-03-29 09:50:11 -0500

isaacb gravatar image

updated 2017-03-29 09:50:40 -0500

Can anyone explain how to add additional IP address to an instance? I have only one flat network with pool of IPs. Thanks.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2017-03-29 10:26:16 -0500

sherv gravatar image

updated 2017-03-29 10:31:45 -0500

Two ways:

add more interfaces to an instance. This way every IP will have it's own policer(if you have any), and if you're using neutron port security(iptables filters), you'll have to assure that source traffic is being sent from the interface that this IP belongs to, otherwise it will be blocked by iptables. Latter can be achieved with iproute2 in linux, no idea about other OSs;

add more IPs to port. Using neutron port-update you can add more than 1 fixed IP to a port, like this:

$ neutron port-update --fixed-ip subnet_id=b63cb5ae-44dd-463a-b27b-686780395bee,ip_address=192.168.1.114 --fixed-ip subnet_id=b63cb5ae-44dd-463a-b27b-686780395bee,ip_address=192.168.1.115 --fixed-ip subnet_id=b63cb5ae-44dd-463a-b27b-686780395bee,ip_address=192.168.1.116 b9f0b04f-a729-46b0-b087-d6a546def45b

$ neutron port-show b9f0b04f-a729-46b0-b087-d6a546def45b
--- output skipped ---
| fixed_ips         | {"subnet_id": "b63cb5ae-...", "ip_address": "192.168.1.114"} |
|                       | {"subnet_id": "b63cb5ae-...", "ip_address": "192.168.1.115"} |
|                       | {"subnet_id": "b63cb5ae-...", "ip_address": "192.168.1.116"} |

This way all IPs will have shared policer, and you don't have to worry about source traffic stickiness. DHCP behaviour hasn't been tested, so either test it youself, or use static configuration. This has been tested, and works as of Newton release.

edit flag offensive delete link more
1

answered 2017-03-29 10:27:38 -0500

Multiple IPs to the same NIC: You need to create a port and add IP addresses. For example, openstack port set --fixed-ip subnet=<subnet>,ip-address=<ip-address> and repeat the fixed-ip option. Then use that port to launch the instance: openstack server create --nic port-id=....

Multiple NICs: Just repeat the nic option of the openstack server create command.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-03-29 09:50:11 -0500

Seen: 1,582 times

Last updated: Mar 29 '17