How to set default server ip and gateway in multiple networks with OpenStack?

asked 2020-07-17 23:16:31 -0600

rawmain gravatar image

updated 2020-07-26 18:12:30 -0600

Use OpenStack's heat template set several networks as


    - network: network1
      vnic_type: direct
        - "IP1"
    - network: network2
      vnic_type: direct
        - "IP2"
    - network: network3
      vnic_type: direct
        - "IP3"

IP2 and IP3 are the same but from different vlans. IP1 is in the third vlan.


  • Gateway1: IP1 (vlan1)
  • Gateway2: IP2 (vlan2), IP3 (vlan3)

After creating the stack, its server_ip became IP2(or IP3). And used vlan2(or vlan3)'s gateway as default gateway.

How to set IP1 as server_ip and use Gateway1 as default gateway?

edit retag flag offensive close merge delete


By using DHCP

tjoen gravatar imagetjoen ( 2020-07-19 04:43:26 -0600 )edit

Do you mean I should use DHCP?

rawmain gravatar imagerawmain ( 2020-07-20 04:02:48 -0600 )edit

It is started by neutron-dhcp-agent

tjoen gravatar imagetjoen ( 2020-07-20 05:11:18 -0600 )edit

Could you tell me how to config it? And how to set right usage in heat template?

rawmain gravatar imagerawmain ( 2020-07-21 00:04:24 -0600 )edit

Haven;t you set iit during creating the subnets in the database?
$ openstack subnet create --dns-nameserver --gateway

tjoen gravatar imagetjoen ( 2020-07-21 00:43:24 -0600 )edit