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

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

rawmain gravatar image

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

Use OpenStack's heat template set several networks as

---
parameters:
...

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

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

Relation:

  • 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

Comments

By using DHCP

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

Do you mean I should use DHCP?

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

It is started by neutron-dhcp-agent

tjoen gravatar imagetjoen ( 2020-07-20 05:11:18 -0500 )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 -0500 )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 -0500 )edit