Ask Your Question
0

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 192.168.1.0/24. When creating router it would occupy IP 192.168.1.1. But lower end of the allocation pool is reserved for other use and I want to have my router use IP 192.168.1.20. Also I still want the virtual machines to use any free floating IP from the 192.168.1.0/24 network.

I know I could use allocation pool staring from 192.168.1.20 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?

UPDATE:

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: http://specs.openstack.org/openstack/... 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
0

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=192.168.1.20 <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

Comments

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

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: 2015-09-16 08:00:39 -0500

Seen: 598 times

Last updated: Sep 18 '15