-2

I'm using openstack liberty.

I have the following network environment:
two networks A and B
network A has a router with external connection
network B has a router without external connection

When I launch a vm in both of those networks I need it to have the default gateway to be pointing to network A, where the external router is.
I tried lauching 5 vms through horizon and gateway assign seems to be random: 3 vms got gateway in network B, 2 vms in network A.

Does openstack have any options to configure it? Modifying the gateway by hand after it launches is not an option.

Artem
  • 1

1 Answers1

1

Network B should not be advertising a default gateway.

When you create a subnet in OpenStack, you have the option of specifying an explicit default gateway, as in:

neutron subnet-create mynetwork 10.0.0.0/24 --gateway 10.0.0.1

But you can also create a subnet that does not have a gateway address:

neutron subnet-create mynetwork 10.0.0.0/24 --no-gateway

If you create a network like this, the DHCP server created by Neutron to manage this network will not offer a default gateway as part of the DHCP lease, so your instances will only have a single default gateway via Network A.

larsks
  • 277,717
  • 41
  • 399
  • 399