Custom ip for virtual router

asked 2015-09-16 08:00:39 -0500

Openstackuser2013 gravatar image

updated 2015-09-18 07:43:22 -0500

When creating virtual router on Neutron is it possible to have router use other than first IP on the allocation pool? I am using Icehouse.

Example: My allocation pool is When creating router it would occupy IP But lower end of the allocation pool is reserved for other use and I want to have my router use IP Also I still want the virtual machines to use any free floating IP from the network.

I know I could use allocation pool staring from to force router take that IP. But that would prevent me from using floating IPs .1-.19 for VMs.

(In this example I used private IPs, in reality the allocation pool would consist of public IPs.)

Is this possible?


Suggested method allowed creating router with custom IP. But how can I make this router usable by telling it that the external network is its default gateway?

The usual command for this does not work:

Error: Failed to set gateway 400-{u'NeutronError': {u'message': u'Bad router request: Router already has a port on subnet ba5d2..., u'type': u'BadRequest', u'detail': u''}}

UPDATE2: This page seems to be indicating that this feature has not yet been implimeted. Or am I reading this wrong?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-09-16 08:30:41 -0500

Yes. You can assign a IP via horizon when you add an network as a router interface or via command line creating first a port with a your IP and next adding to the router interface :

# neutron port-create --fixed-ip subnet_id=<your_subnet_id>,ip_address= <your_network_id>

the previous command return the ID of reserved port and next you can add port to router:

# neutron router-interface-add <your_router_id> port=<your_port_id>
edit flag offensive delete link more


With this setup, how do I set gateway for the router? (See original post for added details.)

Openstackuser2013 gravatar imageOpenstackuser2013 ( 2015-09-18 05:56:11 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-09-16 08:00:39 -0500

Seen: 694 times

Last updated: Sep 18 '15