[Quantum] Control the public IP address assigned to a router by quantum router-gateway-set

Asked by RobertoCanonico

Short question:
is it possible to control the IP address that is given to a router
by the quantum router-gateway-set command ?
In my setup, I have a physical Provider Network associated to a public (routable) IP address range used at my site (X.Y.Z.0/24).
I have created an ExternalNet network by the CLI commands:

quantum net-create ExternalNet --router:external=True
quantum subnet-create ExternalNet X.Y.Z.0/24 --enable_dhcp=False --gateway_ip=X.Y.Z.254

When I issue the quantum router-gateway-set command, the public interface
of the router gets the first address of the X.Y.Z.0/24 range, i.e. X.Y.Z.1,
which, by pure chance, is not used in my physical network.
My setup seems to work OK, VMs are able to ping any other host
in the external network X.Y.Z.0/24, as well as any other Internet host,
through the physical router X.Y.Z.254.

I wonder if is possible to assign to the "virtual" router implemented in Quantum a given address in the range of addresses associated to the external subnet, e.g. X.Y.Z.33.
This might also be useful in the "Per-tenant Routers with Private Networks" use case.
Many thanks in advance for your replies.
Roberto

Question information

Language:
English Edit question
Status:
Solved
For:
neutron Edit question
Assignee:
No assignee Edit question
Solved by:
yong sheng gong
Solved:
Last query:
Last reply:
Revision history for this message
yong sheng gong (gongysh) said :
#1

it IP of the public interface, qgxxx of router is from allocation pool of external network (--router:external=True). the allocation pool should not overlap with IPs of your physical network. why do u want to specify the quantum router's qgxx interface?

Revision history for this message
Baohua Yang (yangbaohua) said :
#2

Try
quantum subnet-create ExternalNet X.Y.Z.Q/24 --enable_dhcp=False --gateway_ip=X.Y.Z.254
Where X.Y.Z.Q is the ip you wanna set the router to.

Revision history for this message
RobertoCanonico (roberto-canonico) said :
#3

@ Baohua Yang (yangbaohua):
thanks for your suggestion, unfortunately it did not work to me, the router still gets the X.Y.Z.1 address

@ yong sheng gong (gongysh):
maybe I am doing something conceptually wrong.
My problem is that I can only use a sparse subset of addresses in the external X.Y.Z.0/24 public range.
The IP address of the physical router is X.Y.Z.254.
My target scenario is called "Provider Router with Private Networks" in the Quantum documentation
(see http://docs.openstack.org/trunk/openstack-network/admin/content/figures/1/figures/UseCase-SingleRouter.png for a reference).
The IP address I would like to assign to my Provider Router is, say, X.Y.Z.33.
My understanding is that I only need one public IP address, as I don't need public floating IP addresses to attach to specific VMs.
If I restrict the size of the allocation pool to a small range including X.Y.X.33, I am not able to ping the
physical router X.Y.X.254 from my VMs, and hence no Internet connectivity is allowed to them.

Revision history for this message
Best yong sheng gong (gongysh) said :
#4

It makes sense, I created a bug for it.

Revision history for this message
RobertoCanonico (roberto-canonico) said :
#5

Thanks yong sheng gong, that solved my question.